This repository has been archived on 2024-02-08. You can view files and clone it, but cannot push or open issues or pull requests.
frontend/src/modelSchema/user.ts

21 lines
558 B
TypeScript

import { type TypeOf, string } from 'zod'
import { IdSchema } from './common/id'
import { DateSchema } from './common/date'
import { AbstractSchema } from './abstract'
import { UserSettingsSchema } from './userSettings'
export const UserSchema = AbstractSchema.extend({
id: IdSchema.default(0),
email: string().email().default(''),
username: string().default(''),
name: string().default(''),
settings: UserSettingsSchema.nullable(),
created: DateSchema.nullable(),
updated: DateSchema.nullable(),
})
export type User = TypeOf<typeof UserSchema>