simple-review-server/src/types.ts

10 lines
256 B
TypeScript
Raw Normal View History

2024-08-16 15:04:52 -04:00
import { object, string, number, InferType } from "yup";
export const reviewSchema = object({
username: string().required(),
rating: number().positive().max(5).required(),
content: string(),
});
export type Review = InferType<typeof reviewSchema>;