mirror of
https://github.com/documenso/documenso.git
synced 2026-07-14 06:47:10 +10:00
7ea664214a
## Description Add envelopes V2 embedded support --------- Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
32 lines
784 B
TypeScript
32 lines
784 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,
|
|
});
|
|
});
|