mirror of
https://github.com/BradNut/TofuStack
synced 2025-09-08 17:40:26 +00:00
24 lines
1.1 KiB
TypeScript
24 lines
1.1 KiB
TypeScript
import { z } from 'zod';
|
|
|
|
/* -------------------------------------------------------------------------- */
|
|
/* DTO */
|
|
/* -------------------------------------------------------------------------- */
|
|
/* -------------------------------------------------------------------------- */
|
|
/* ---------------------------------- About --------------------------------- */
|
|
/*
|
|
Data Transfer Objects (DTOs) are used to define the shape of data that is passed.
|
|
They are used to validate data and ensure that the correct data is being passed
|
|
to the correct methods.
|
|
*/
|
|
/* ---------------------------------- Notes --------------------------------- */
|
|
/*
|
|
DTO's are pretty flexible. You can use them anywhere you want in this application to
|
|
validate or shape data. They are especially useful in API routes and services to
|
|
ensure that the correct data is being passed around.
|
|
*/
|
|
/* -------------------------------------------------------------------------- */
|
|
|
|
export const updateEmailDto = z.object({
|
|
email: z.string().email()
|
|
});
|
|
export type UpdateEmailDto = z.infer<typeof updateEmailDto>;
|