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/userShareBase.ts

20 lines
523 B
TypeScript

import type {TypeOf} from 'zod'
import {nativeEnum} from 'zod'
import {IdSchema} from './common/id'
import {DateSchema} from './common/date'
import {AbstractSchema} from './abstract'
import {RIGHTS} from '@/constants/rights'
export const UserShareBaseSchema = AbstractSchema.extend({
userId: IdSchema, // FIXME: default of model is `''`
right: nativeEnum(RIGHTS).default(RIGHTS.READ),
created: DateSchema.nullable(),
updated: DateSchema.nullable(),
})
export type TeamMember = TypeOf<typeof UserShareBaseSchema>