import { HTTPBody } from '@fastify-modular/route'; import {pito} from 'pito'; import { NeedLogin } from '../defines'; import {GenderType, NationalityType} from '../enums'; // ========================================================================== export const EditMyselfInput = pito.Obj({ phoneNumber : pito.Opt(pito.Str({})), nickName : pito.Opt(pito.Str({})), birth : pito.Opt(pito.Date()), NationalityType: pito.Opt(pito.Enums(NationalityType)), GenderType : pito.Opt(pito.Enums(GenderType)), }); export type EditMyselfInput = pito.Type; // ========================================================================== export const EditMyselfOption = pito.Obj({}); export type EditMyselfOption = pito.Type; // ========================================================================== export const EditMyselfOutput = pito.Obj({}); export type EditMyselfOutput = pito.Type; // ========================================================================== export const EditMyself = HTTPBody('PATCH', '/api/v1/auth/edit-myself', 'user') .body(EditMyselfInput) .query(EditMyselfOption) .response(EditMyselfOutput) .presets(NeedLogin) .build(); // ==========================================================================