refactor: Move inline Zod schemas from routes to validator files
Create ai-kurzy.validators.js and service.validators.js with schemas extracted from their respective route files. Routes now import schemas instead of defining them inline. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
22
src/validators/service.validators.js
Normal file
22
src/validators/service.validators.js
Normal file
@@ -0,0 +1,22 @@
|
||||
import { z } from 'zod';
|
||||
|
||||
export const serviceIdSchema = z.object({
|
||||
serviceId: z.string().uuid(),
|
||||
});
|
||||
|
||||
export const folderIdSchema = z.object({
|
||||
folderId: z.string().uuid(),
|
||||
});
|
||||
|
||||
export const folderDocumentIdSchema = z.object({
|
||||
folderId: z.string().uuid(),
|
||||
documentId: z.string().uuid(),
|
||||
});
|
||||
|
||||
export const createFolderSchema = z.object({
|
||||
name: z.string().min(1).max(255),
|
||||
});
|
||||
|
||||
export const updateFolderSchema = z.object({
|
||||
name: z.string().min(1).max(255),
|
||||
});
|
||||
Reference in New Issue
Block a user