mirror of
https://github.com/documenso/documenso.git
synced 2026-07-27 10:25:00 +10:00
fix: return all documents from V1 API regardless of folder (#2471)
This commit is contained in:
@@ -67,6 +67,7 @@ export const ApiContractV1Implementation = tsr.router(ApiContractV1, {
|
||||
perPage,
|
||||
userId: user.id,
|
||||
teamId: team.id,
|
||||
folderId: args.query.folderId,
|
||||
});
|
||||
|
||||
return {
|
||||
@@ -77,6 +78,7 @@ export const ApiContractV1Implementation = tsr.router(ApiContractV1, {
|
||||
externalId: document.externalId,
|
||||
userId: document.userId,
|
||||
teamId: document.teamId,
|
||||
folderId: document.folderId,
|
||||
title: document.title,
|
||||
status: document.status,
|
||||
createdAt: document.createdAt,
|
||||
@@ -164,6 +166,7 @@ export const ApiContractV1Implementation = tsr.router(ApiContractV1, {
|
||||
externalId: envelope.externalId,
|
||||
userId: envelope.userId,
|
||||
teamId: envelope.teamId,
|
||||
folderId: envelope.folderId,
|
||||
title: envelope.title,
|
||||
status: envelope.status,
|
||||
createdAt: envelope.createdAt,
|
||||
|
||||
@@ -35,6 +35,10 @@ export const ZNoBodyMutationSchema = null;
|
||||
export const ZGetDocumentsQuerySchema = z.object({
|
||||
page: z.coerce.number().min(1).optional().default(1),
|
||||
perPage: z.coerce.number().min(1).optional().default(10),
|
||||
folderId: z
|
||||
.string()
|
||||
.describe('Filter documents by folder ID. When omitted, returns root documents.')
|
||||
.optional(),
|
||||
});
|
||||
|
||||
export type TGetDocumentsQuerySchema = z.infer<typeof ZGetDocumentsQuerySchema>;
|
||||
@@ -48,6 +52,7 @@ export const ZSuccessfulDocumentResponseSchema = z.object({
|
||||
externalId: z.string().nullish(),
|
||||
userId: z.number(),
|
||||
teamId: z.number().nullish(),
|
||||
folderId: z.string().nullish(),
|
||||
title: z.string(),
|
||||
status: z.string(),
|
||||
createdAt: z.date(),
|
||||
|
||||
Reference in New Issue
Block a user