design nosepass template, add tests, add template previews

This commit is contained in:
Amruth Pillai
2023-11-17 08:31:12 +01:00
parent 0b4cb71320
commit 34247f13b6
92 changed files with 24440 additions and 35518 deletions

View File

@ -1,7 +1,9 @@
import { t } from "@lingui/macro";
import { StatisticsDto, UrlDto } from "@reactive-resume/dto";
import { useMutation } from "@tanstack/react-query";
import { RESUME_KEY } from "@/client/constants/query-keys";
import { toast } from "@/client/hooks/use-toast";
import { axios } from "@/client/libs/axios";
import { queryClient } from "@/client/libs/query-client";
@ -24,6 +26,15 @@ export const usePrintResume = () => {
return { ...cache, downloads: cache.downloads + 1 } satisfies StatisticsDto;
});
},
onError: (error) => {
const message = error?.message;
toast({
variant: "error",
title: t`Oops, the server returned an error.`,
description: message,
});
},
});
return { printResume: printResumeFn, loading, error };