17 lines
432 B
TypeScript
17 lines
432 B
TypeScript
import { z } from 'zod';
|
|
|
|
import { uuidSchema } from './_shared';
|
|
|
|
export const postMediaTypeSchema = z.enum(['IMAGE', 'VIDEO']);
|
|
|
|
export const postMediaSchema = z.object({
|
|
id: uuidSchema,
|
|
post_id: uuidSchema,
|
|
url: z.string().url(),
|
|
type: postMediaTypeSchema,
|
|
duration_seconds: z.number().int().min(0).nullable(),
|
|
display_order: z.number().int().default(0),
|
|
});
|
|
|
|
export type PostMedia = z.infer<typeof postMediaSchema>;
|