vikunja/frontend/src/modelSchema/backgroundImage.ts
Dominik Pschenitschni f48225159b
Some checks failed
continuous-integration/drone/pr Build is failing
feat: add zod schemas
(cherry picked from commit vikunja/frontend#2225)
2024-02-08 11:48:53 +01:00

19 lines
552 B
TypeScript

import type {TypeOf} from 'zod'
import {object, record, string, unknown} from 'zod'
import {IdSchema} from './common/id'
export const BackgroundImageSchema = object({
id: IdSchema.default(0),
url: string().url().default(''),
thumb: string().default(''),
// FIXME: not sure if this needs to defined, since it seems provider specific
// {
// author: string(),
// authorName: string(),
// }
info: record(unknown()).default({}),
blurHash: string().default(''),
})
export type BackgroundImage = TypeOf<typeof BackgroundImageSchema>