initttt
This commit is contained in:
12
packages/logic/core/pagination.utils.ts
Normal file
12
packages/logic/core/pagination.utils.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
import * as v from "valibot";
|
||||
|
||||
export const paginationModel = v.object({
|
||||
cursor: v.optional(v.string()),
|
||||
limit: v.pipe(v.number(), v.integer(), v.maxValue(100)),
|
||||
asc: v.optional(v.boolean(), true),
|
||||
totalItemCount: v.optional(v.pipe(v.number(), v.integer()), 0),
|
||||
totalPages: v.pipe(v.number(), v.integer()),
|
||||
page: v.pipe(v.number(), v.integer()),
|
||||
});
|
||||
|
||||
export type PaginationModel = v.InferOutput<typeof paginationModel>;
|
||||
Reference in New Issue
Block a user