mirror of
https://github.com/documenso/documenso.git
synced 2025-11-14 08:42:12 +10:00
feat: add envelopes api (#2105)
This commit is contained in:
@ -0,0 +1,30 @@
|
||||
import { deleteEnvelopeRecipient } from '@documenso/lib/server-only/recipient/delete-envelope-recipient';
|
||||
|
||||
import { authenticatedProcedure } from '../../trpc';
|
||||
import {
|
||||
ZDeleteEnvelopeRecipientRequestSchema,
|
||||
ZDeleteEnvelopeRecipientResponseSchema,
|
||||
deleteEnvelopeRecipientMeta,
|
||||
} from './delete-envelope-recipient.types';
|
||||
|
||||
export const deleteEnvelopeRecipientRoute = authenticatedProcedure
|
||||
.meta(deleteEnvelopeRecipientMeta)
|
||||
.input(ZDeleteEnvelopeRecipientRequestSchema)
|
||||
.output(ZDeleteEnvelopeRecipientResponseSchema)
|
||||
.mutation(async ({ input, ctx }) => {
|
||||
const { user, teamId, metadata } = ctx;
|
||||
const { recipientId } = input;
|
||||
|
||||
ctx.logger.info({
|
||||
input: {
|
||||
recipientId,
|
||||
},
|
||||
});
|
||||
|
||||
await deleteEnvelopeRecipient({
|
||||
userId: user.id,
|
||||
teamId,
|
||||
recipientId,
|
||||
requestMetadata: metadata,
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user