mirror of
https://github.com/documenso/documenso.git
synced 2025-11-12 15:53:02 +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.
37 lines
857 B
TypeScript
37 lines
857 B
TypeScript
import { updateEnvelope } from '@documenso/lib/server-only/envelope/update-envelope';
|
|
|
|
import { authenticatedProcedure } from '../trpc';
|
|
import {
|
|
ZUpdateEnvelopeRequestSchema,
|
|
ZUpdateEnvelopeResponseSchema,
|
|
} from './update-envelope.types';
|
|
|
|
export const updateEnvelopeRoute = authenticatedProcedure
|
|
// .meta(updateEnvelopeTrpcMeta)
|
|
.input(ZUpdateEnvelopeRequestSchema)
|
|
.output(ZUpdateEnvelopeResponseSchema)
|
|
.mutation(async ({ input, ctx }) => {
|
|
const { teamId } = ctx;
|
|
const { envelopeId, data, meta = {} } = input;
|
|
|
|
ctx.logger.info({
|
|
input: {
|
|
envelopeId,
|
|
},
|
|
});
|
|
|
|
const userId = ctx.user.id;
|
|
|
|
return await updateEnvelope({
|
|
userId,
|
|
teamId,
|
|
id: {
|
|
type: 'envelopeId',
|
|
id: envelopeId,
|
|
},
|
|
data,
|
|
meta,
|
|
requestMetadata: ctx.metadata,
|
|
});
|
|
});
|