fix: return of document after delete

This commit is contained in:
Rohit Saluja
2024-03-26 19:19:02 +05:30
parent 2296924ef6
commit bd703fb620

View File

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