mirror of
https://github.com/documenso/documenso.git
synced 2025-11-13 16:23:06 +10:00
feat: add route for retrieving a single document by id
This commit is contained in:
@ -24,14 +24,29 @@ const SuccessfulResponse = z.object({
|
||||
totalPages: z.number(),
|
||||
});
|
||||
|
||||
export const contract = c.router({
|
||||
getDocuments: {
|
||||
method: 'GET',
|
||||
path: '/documents',
|
||||
query: GetDocumentsQuery,
|
||||
responses: {
|
||||
200: SuccessfulResponse,
|
||||
export const contract = c.router(
|
||||
{
|
||||
getDocuments: {
|
||||
method: 'GET',
|
||||
path: '/documents',
|
||||
query: GetDocumentsQuery,
|
||||
responses: {
|
||||
200: SuccessfulResponse,
|
||||
},
|
||||
summary: 'Get all documents',
|
||||
},
|
||||
getDocument: {
|
||||
method: 'GET',
|
||||
path: `/documents/:id`,
|
||||
responses: {
|
||||
200: DocumentSchema,
|
||||
},
|
||||
summary: 'Get a single document',
|
||||
},
|
||||
summary: 'Get all documents for a user',
|
||||
},
|
||||
});
|
||||
{
|
||||
baseHeaders: z.object({
|
||||
authorization: z.string(),
|
||||
}),
|
||||
},
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user