mirror of
https://github.com/documenso/documenso.git
synced 2026-07-11 21:45:18 +10:00
29 lines
779 B
TypeScript
29 lines
779 B
TypeScript
import { getEditorEnvelopeById } from '@documenso/lib/server-only/envelope/get-editor-envelope-by-id';
|
|
|
|
import { authenticatedProcedure } from '../trpc';
|
|
import { ZGetEditorEnvelopeRequestSchema, ZGetEditorEnvelopeResponseSchema } from './get-editor-envelope.types';
|
|
|
|
export const getEditorEnvelopeRoute = authenticatedProcedure
|
|
.input(ZGetEditorEnvelopeRequestSchema)
|
|
.output(ZGetEditorEnvelopeResponseSchema)
|
|
.query(async ({ input, ctx }) => {
|
|
const { teamId, user } = ctx;
|
|
const { envelopeId } = input;
|
|
|
|
ctx.logger.info({
|
|
input: {
|
|
envelopeId,
|
|
},
|
|
});
|
|
|
|
return await getEditorEnvelopeById({
|
|
userId: user.id,
|
|
teamId,
|
|
id: {
|
|
type: 'envelopeId',
|
|
id: envelopeId,
|
|
},
|
|
type: null,
|
|
});
|
|
});
|