mirror of
https://github.com/kjanat/livedash-node.git
synced 2026-01-16 21:32:08 +01:00
feat(sessions): add missing language, sortKey, and sortOrder filtering support
- Add language field with ISO 639-1 validation to sessionFilterSchema - Add sortKey enum with startTime, category, language, sentiment, sessionId options - Add sortOrder enum with asc/desc options - Update tRPC router to support new filtering and sorting parameters - Uncomment frontend code to enable full filtering functionality - Add comprehensive validation tests for new schema fields Resolves commented out filter options in app/dashboard/sessions/page.tsx lines 491-502
This commit is contained in:
@ -71,8 +71,16 @@ export const sessionFilterSchema = z.object({
|
||||
"UNRECOGNIZED_OTHER",
|
||||
])
|
||||
.optional(),
|
||||
language: z
|
||||
.string()
|
||||
.regex(/^[a-z]{2}$/)
|
||||
.optional(),
|
||||
startDate: z.string().datetime().optional(),
|
||||
endDate: z.string().datetime().optional(),
|
||||
sortKey: z
|
||||
.enum(["startTime", "category", "language", "sentiment", "sessionId"])
|
||||
.default("startTime"),
|
||||
sortOrder: z.enum(["asc", "desc"]).default("desc"),
|
||||
page: z.number().int().min(1).default(1),
|
||||
limit: z.number().int().min(1).max(100).default(20),
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user