16 lines
389 B
TypeScript
16 lines
389 B
TypeScript
import { z } from 'zod';
|
|
|
|
import { timestampSchema, uuidSchema } from './_shared';
|
|
|
|
export const commentSchema = z.object({
|
|
id: uuidSchema,
|
|
post_id: uuidSchema,
|
|
user_id: uuidSchema,
|
|
parent_comment_id: uuidSchema.nullable(),
|
|
content: z.string().trim().min(1),
|
|
created_at: timestampSchema,
|
|
updated_at: timestampSchema,
|
|
});
|
|
|
|
export type Comment = z.infer<typeof commentSchema>;
|