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

21 lines
639 B
TypeScript

import { type TypeOf, string } from 'zod'
import { AbstractSchema } from './abstract'
import { DateSchema } from './common/date'
import { FilterSchema } from './common/filter'
import { IdSchema } from './common/id'
import { UserSchema } from './user'
// FIXME: is it correct that this extends the Abstract Schema?
export const SavedFilterSchema = AbstractSchema.extend({
id: IdSchema.default(0),
title: string().default(''),
description: string().default(''),
filters: FilterSchema,
owner: UserSchema,
created: DateSchema.nullable(),
updated: DateSchema.nullable(),
})
export type SavedFilter = TypeOf<typeof SavedFilterSchema>