mirror of
https://github.com/documenso/documenso.git
synced 2025-11-13 00:03:33 +10:00
38 lines
1.0 KiB
TypeScript
38 lines
1.0 KiB
TypeScript
import { deleteEnvelopeRecipient } from '@documenso/lib/server-only/recipient/delete-envelope-recipient';
|
|
|
|
import { authenticatedProcedure } from '../../trpc';
|
|
import {
|
|
ZDeleteEnvelopeRecipientRequestSchema,
|
|
ZDeleteEnvelopeRecipientResponseSchema,
|
|
} from './delete-envelope-recipient.types';
|
|
|
|
export const deleteEnvelopeRecipientRoute = authenticatedProcedure
|
|
.meta({
|
|
openapi: {
|
|
method: 'POST',
|
|
path: '/envelope/recipient/delete',
|
|
summary: 'Delete envelope recipient',
|
|
description: 'Delete an envelope recipient',
|
|
tags: ['Envelope Recipient'],
|
|
},
|
|
})
|
|
.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,
|
|
});
|
|
});
|