mirror of
https://github.com/documenso/documenso.git
synced 2026-07-10 13:06:00 +10:00
844af17ec2
Each direct mailer.sendMail() call is replaced by a dedicated background job so that email delivery failures can be retried independently. New jobs: send-pending-email, send-completed-email, send-forgot-password-email, send-document-super-delete-email, send-recipient-removed-email, send-document-deleted-emails, send-2fa-token-email, send-resend-document-email, send-direct-template-created-email. Existing handlers (send-document-cancelled-emails, send-organisation-member-*, send-recipient-signed-email) have io.runTask wrappers removed since they interfere with the job scheduler. Job triggers are dispatched after transactions commit to avoid race conditions with uncommitted data.
27 lines
669 B
TypeScript
27 lines
669 B
TypeScript
import { adminSuperDeleteDocument } from '@documenso/lib/server-only/admin/admin-super-delete-document';
|
|
|
|
import { adminProcedure } from '../trpc';
|
|
import {
|
|
ZDeleteDocumentRequestSchema,
|
|
ZDeleteDocumentResponseSchema,
|
|
} from './delete-document.types';
|
|
|
|
export const deleteDocumentRoute = adminProcedure
|
|
.input(ZDeleteDocumentRequestSchema)
|
|
.output(ZDeleteDocumentResponseSchema)
|
|
.mutation(async ({ ctx, input }) => {
|
|
const { id, reason } = input;
|
|
|
|
ctx.logger.info({
|
|
input: {
|
|
id,
|
|
},
|
|
});
|
|
|
|
await adminSuperDeleteDocument({
|
|
envelopeId: id,
|
|
reason,
|
|
requestMetadata: ctx.metadata.requestMetadata,
|
|
});
|
|
});
|