clean up validation, still not happy

This commit is contained in:
rubikscraft
2022-04-02 23:25:49 +02:00
parent 805ff8ab0e
commit bcd427f5a7
43 changed files with 307 additions and 277 deletions

View File

@@ -1,14 +1,14 @@
import { validate } from 'class-validator';
import { validate, ValidatorOptions } from 'class-validator';
// For some stupid reason, the class-validator library does not have a way to set global defaults
// So now we have to do it this way
export const ValidateOptions = {
disableErrorMessages: true,
export const ValidateOptions: ValidatorOptions = {
forbidNonWhitelisted: true,
forbidUnknownValues: true,
stopAtFirstError: true,
whitelist: true,
strictGroups: true,
};
export const strictValidate = (object: object) =>