mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-10-18 21:16:47 +00:00
feat(shared): add fileUploadRequestSchema for the files upload body
This commit is contained in:
@@ -14,6 +14,17 @@ import { z } from 'zod';
|
||||
|
||||
const nullableIdField = z.union([z.string(), z.number()]).nullable().optional();
|
||||
|
||||
/**
|
||||
* Multipart text fields riding along with the upload — always strings on the
|
||||
* wire (multipart/form-data has no other type), so no numeric coercion here.
|
||||
*/
|
||||
export const fileUploadRequestSchema = z.object({
|
||||
place_id: z.string().optional(),
|
||||
description: z.string().optional(),
|
||||
reservation_id: z.string().optional(),
|
||||
});
|
||||
export type FileUploadRequest = z.infer<typeof fileUploadRequestSchema>;
|
||||
|
||||
export const fileUpdateRequestSchema = z.object({
|
||||
description: z.string().optional(),
|
||||
place_id: nullableIdField,
|
||||
|
||||
Reference in New Issue
Block a user