fix: refactor teams router (#1500)

This commit is contained in:
David Nguyen
2024-12-05 22:14:47 +09:00
committed by GitHub
parent 9e8094e34c
commit 9f45fe62e4
38 changed files with 364 additions and 97 deletions

View File

@ -1,3 +1,14 @@
import { z } from 'zod';
export const ZFindResultSet = z.object({
data: z.union([z.array(z.unknown()), z.unknown()]),
count: z.number(),
currentPage: z.number(),
perPage: z.number(),
totalPages: z.number(),
});
// Can't infer generics from Zod.
export type FindResultSet<T> = {
data: T extends Array<unknown> ? T : T[];
count: number;