fix: fixed the no document error

This commit is contained in:
Rohit Saluja
2024-03-27 09:55:30 +05:30
parent 9eaecfcef2
commit 0aa111cd6e

View File

@@ -126,9 +126,8 @@ export const adminRouter = router({
.mutation(async ({ input }) => { .mutation(async ({ input }) => {
const { id, userId, reason } = input; const { id, userId, reason } = input;
try { try {
const document = await superDeleteDocument({ id, userId });
await sendDeleteEmail({ documentId: id, reason }); await sendDeleteEmail({ documentId: id, reason });
return document; return await superDeleteDocument({ id, userId });
} catch (err) { } catch (err) {
console.log(err); console.log(err);
throw new TRPCError({ throw new TRPCError({