TofuStack/src/lib/dtos/update-email.dto.ts

25 lines
1.1 KiB
TypeScript
Raw Normal View History

2024-05-25 06:02:26 +00:00
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.
*/
/* -------------------------------------------------------------------------- */
2024-05-25 06:02:26 +00:00
export const updateEmailDto = z.object({
email: z.string()
});
export type UpdateEmailDto = z.infer<typeof updateEmailDto>;