From 9f825b9adf67529fe4c2972b92d4405d2ae89477 Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Fri, 6 Jan 2023 16:58:39 -0500 Subject: [PATCH] fix: Allow sort by title in documents.list --- server/routes/api/documents/schema.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/routes/api/documents/schema.ts b/server/routes/api/documents/schema.ts index 78fb92339..286ed977c 100644 --- a/server/routes/api/documents/schema.ts +++ b/server/routes/api/documents/schema.ts @@ -8,7 +8,7 @@ const DocumentsSortParamsSchema = z.object({ /** Specifies the attributes by which documents will be sorted in the list */ sort: z .string() - .refine((val) => ["createdAt", "updatedAt", "index"].includes(val)) + .refine((val) => ["createdAt", "updatedAt", "index", "title"].includes(val)) .default("updatedAt"), /** Specifies the sort order with respect to sort field */