mirror of
https://github.com/documenso/documenso.git
synced 2025-11-17 10:11:35 +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({
|
||||
|
||||
@ -20,6 +20,7 @@
|
||||
"@ts-rest/core": "^3.30.5",
|
||||
"@ts-rest/next": "^3.30.5",
|
||||
"luxon": "^3.4.0",
|
||||
"@ts-rest/open-api": "^3.30.5",
|
||||
"superjson": "^1.13.1",
|
||||
"ts-pattern": "^5.0.5",
|
||||
"zod": "^3.22.4"
|
||||
|
||||
Reference in New Issue
Block a user