feat: add createdAt and updatedAt fields to Article model and implement article pagination with new components
This commit is contained in:
10
src/utils/types/pagination.ts
Normal file
10
src/utils/types/pagination.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
import { z } from 'zod';
|
||||
|
||||
export const Pagination = <T extends z.ZodTypeAny>(itemSchema: T) =>
|
||||
z.object({
|
||||
data: z.array(itemSchema),
|
||||
total: z.number(),
|
||||
page: z.number(),
|
||||
pageSize: z.number(),
|
||||
totalPages: z.number(),
|
||||
});
|
||||
Reference in New Issue
Block a user