initial-commit (#1)
Reviewed-on: #1 Co-authored-by: Timo Behrendt <t.behrendt@t00n.de> Co-committed-by: Timo Behrendt <t.behrendt@t00n.de>
This commit was merged in pull request #1.
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
import { z } from "zod";
|
||||
|
||||
const positiveInteger = z.number().int().positive();
|
||||
const uuid = z.string().uuid();
|
||||
const optionalUuid = uuid.optional();
|
||||
|
||||
// Pagination
|
||||
export const offset = positiveInteger.optional();
|
||||
export const limit = positiveInteger.optional().default(10);
|
||||
export const sort = z.enum(["createdAt", "updatedAt", "title"]).optional();
|
||||
export const direction = z
|
||||
.enum(["asc", "desc"])
|
||||
.optional()
|
||||
.transform((val) => val?.toUpperCase() as "ASC" | "DESC" | undefined);
|
||||
|
||||
export const collectionId = optionalUuid;
|
||||
export const userId = optionalUuid;
|
||||
export const backlinkDocumentId = optionalUuid;
|
||||
export const parentDocumentId = optionalUuid;
|
||||
Reference in New Issue
Block a user