mirror of
https://github.com/CaramelFur/Picsur.git
synced 2025-11-13 23:35:39 +01:00
switch to zod
This commit is contained in:
@@ -1,14 +1,9 @@
|
||||
import { IsOptional, IsString } from 'class-validator';
|
||||
import { z } from 'zod';
|
||||
import { IsEntityID } from '../validators/entity-id.validator';
|
||||
|
||||
export class ESysPreference {
|
||||
@IsOptional()
|
||||
@IsEntityID()
|
||||
id?: string;
|
||||
|
||||
@IsString()
|
||||
key: string;
|
||||
|
||||
@IsString()
|
||||
value: string;
|
||||
}
|
||||
export const ESysPreferenceSchema = z.object({
|
||||
id: IsEntityID().optional(),
|
||||
key: z.string(),
|
||||
value: z.string(),
|
||||
});
|
||||
export type ESysPreference = z.infer<typeof ESysPreferenceSchema>;
|
||||
|
||||
Reference in New Issue
Block a user