Spaces:
Sleeping
Sleeping
File size: 418 Bytes
a99a515 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
import { Expose, Transform } from "class-transformer";
export class AdminSerialization {
@Expose({ name: "_id" })
id: string;
@Expose()
name: string;
@Expose()
email: string;
@Expose()
image: object;
@Expose()
role: string;
@Expose()
gender: string;
@Expose({ name: "dob" })
@Transform(
({ value }) => new Date().getFullYear() - (value as Date).getFullYear()
)
age: number;
} |