mirror of
https://github.com/documenso/documenso.git
synced 2025-11-14 00:32:43 +10:00
chore: update routes
trying to add the route for creating documents
This commit is contained in:
@ -23,6 +23,18 @@ const DocumentSchema = z.object({
|
||||
completedAt: z.date().nullable(),
|
||||
});
|
||||
|
||||
const SendDocumentForSigningMutationSchema = z.object({
|
||||
signerEmail: z.string(),
|
||||
signerName: z.string().optional(),
|
||||
});
|
||||
|
||||
const UploadDocumentSuccessfulSchema = z.object({
|
||||
uploadedFile: z.object({
|
||||
id: z.number(),
|
||||
message: z.string(),
|
||||
}),
|
||||
});
|
||||
|
||||
const SuccessfulResponseSchema = z.object({
|
||||
documents: DocumentSchema.array(),
|
||||
totalPages: z.number(),
|
||||
@ -66,6 +78,18 @@ export const contract = c.router(
|
||||
},
|
||||
summary: 'Delete a document',
|
||||
},
|
||||
createDocument: {
|
||||
method: 'POST',
|
||||
path: '/documents',
|
||||
contentType: 'multipart/form-data',
|
||||
body: c.type<{ file: File }>(),
|
||||
responses: {
|
||||
200: UploadDocumentSuccessfulSchema,
|
||||
401: UnsuccessfulResponseSchema,
|
||||
500: UnsuccessfulResponseSchema,
|
||||
},
|
||||
summary: 'Upload a new document',
|
||||
},
|
||||
},
|
||||
{
|
||||
baseHeaders: z.object({
|
||||
|
||||
Reference in New Issue
Block a user