Workflow and API validation for input file types

(still needs to be ckecked if a pdf is valid)
This commit is contained in:
Felix Kaspar
2023-12-21 16:42:00 +01:00
parent efd8b48a3f
commit 3e10972efa
6 changed files with 37 additions and 40 deletions

View File

@@ -19,10 +19,11 @@ export function validateOperations(actions: Action[]): { valid: boolean, reason?
if(!operator) {
return { valid: false, reason: `action.type ${action.type} does not exist` }
}
const validationResult = new operator(action).validate();
const validationResult = operator.schema.validate({values: action.values});
if(!validationResult.valid) {
return validationResult;
// TODO: convert everything to joiresult format
if(validationResult.error) {
return { valid: false, reason: validationResult.error.message};
}
if (action.actions) {