mirror of
https://github.com/documenso/documenso.git
synced 2025-11-10 04:22:32 +10:00
This PR is handles the changes required to support envelopes. The new envelope editor/signing page will be hidden during release. The core changes here is to migrate the documents and templates model to a centralized envelopes model. Even though Documents and Templates are removed, from the user perspective they will still exist as we remap envelopes to documents and templates.
29 lines
800 B
TypeScript
29 lines
800 B
TypeScript
import { adminSuperDeleteDocument } from '@documenso/lib/server-only/admin/admin-super-delete-document';
|
|
import { sendDeleteEmail } from '@documenso/lib/server-only/document/send-delete-email';
|
|
|
|
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 sendDeleteEmail({ envelopeId: id, reason });
|
|
|
|
await adminSuperDeleteDocument({
|
|
envelopeId: id,
|
|
requestMetadata: ctx.metadata.requestMetadata,
|
|
});
|
|
});
|