mirror of
https://github.com/documenso/documenso.git
synced 2025-11-13 08:13:56 +10:00
feat: add attachments (#2091)
This commit is contained in:
@ -0,0 +1,37 @@
|
||||
import { updateAttachment } from '@documenso/lib/server-only/envelope-attachment/update-attachment';
|
||||
|
||||
import { authenticatedProcedure } from '../../trpc';
|
||||
import {
|
||||
ZUpdateAttachmentRequestSchema,
|
||||
ZUpdateAttachmentResponseSchema,
|
||||
} from './update-attachment.types';
|
||||
|
||||
export const updateAttachmentRoute = authenticatedProcedure
|
||||
.meta({
|
||||
openapi: {
|
||||
method: 'POST',
|
||||
path: '/envelope/attachment/update',
|
||||
summary: 'Update attachment',
|
||||
description: 'Update an existing attachment',
|
||||
tags: ['Envelope'],
|
||||
},
|
||||
})
|
||||
.input(ZUpdateAttachmentRequestSchema)
|
||||
.output(ZUpdateAttachmentResponseSchema)
|
||||
.mutation(async ({ input, ctx }) => {
|
||||
const { teamId } = ctx;
|
||||
const userId = ctx.user.id;
|
||||
|
||||
const { id, data } = input;
|
||||
|
||||
ctx.logger.info({
|
||||
input: { id },
|
||||
});
|
||||
|
||||
await updateAttachment({
|
||||
id,
|
||||
userId,
|
||||
teamId,
|
||||
data,
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user