mirror of
https://github.com/documenso/documenso.git
synced 2025-11-13 08:13:56 +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.
33 lines
789 B
TypeScript
33 lines
789 B
TypeScript
import { getDocumentWithDetailsById } from '@documenso/lib/server-only/document/get-document-with-details-by-id';
|
|
|
|
import { authenticatedProcedure } from '../trpc';
|
|
import {
|
|
ZGetDocumentRequestSchema,
|
|
ZGetDocumentResponseSchema,
|
|
getDocumentMeta,
|
|
} from './get-document.types';
|
|
|
|
export const getDocumentRoute = authenticatedProcedure
|
|
.meta(getDocumentMeta)
|
|
.input(ZGetDocumentRequestSchema)
|
|
.output(ZGetDocumentResponseSchema)
|
|
.query(async ({ input, ctx }) => {
|
|
const { teamId, user } = ctx;
|
|
const { documentId } = input;
|
|
|
|
ctx.logger.info({
|
|
input: {
|
|
documentId,
|
|
},
|
|
});
|
|
|
|
return await getDocumentWithDetailsById({
|
|
userId: user.id,
|
|
teamId,
|
|
id: {
|
|
type: 'documentId',
|
|
id: documentId,
|
|
},
|
|
});
|
|
});
|