make uid optionnal for creation
This commit is contained in:
parent
42c89da2fa
commit
ed6b0afc10
@ -2,8 +2,8 @@ import { type ClassTransformOptions, plainToClassFromExist } from "class-transfo
|
||||
import validator, { IsNotEmpty, ValidatorOptions } from "class-validator";
|
||||
|
||||
export default class Resource {
|
||||
@IsNotEmpty({ message: "UID is required" })
|
||||
public uid!: string;
|
||||
@IsNotEmpty({ groups: ["update"] ,message: "UID is required" })
|
||||
public uid?: string;
|
||||
|
||||
public static hydrate<T extends Resource>(from: Partial<T>, options?: ClassTransformOptions) : T {
|
||||
const self: T = new (this as any);
|
||||
|
Loading…
x
Reference in New Issue
Block a user