Skip to content

Commit a1cbdd0

Browse files
committed
made optimizations
1 parent b3d6956 commit a1cbdd0

1 file changed

Lines changed: 4 additions & 9 deletions

File tree

src/backend/src/utils/validation.utils.ts

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -211,15 +211,10 @@ export const materialValidators = [
211211
];
212212
export const copyMaterialsValidators = [
213213
body('materialIds').isArray({ min: 1 }),
214-
body('materialIds.*').isString().notEmpty(),
215-
body('destinationWbsNum')
216-
.custom((value) => {
217-
validateWBS(value);
218-
return true;
219-
})
220-
.customSanitizer((value) => {
221-
return validateWBS(value);
222-
})
214+
nonEmptyString(body('materialIds.*')),
215+
body('destinationWbsNum').customSanitizer((value) => {
216+
return validateWBS(value);
217+
})
223218
];
224219
export const validateInputs = (req: Request, res: Response, next: Function): void => {
225220
const errors = validationResult(req);

0 commit comments

Comments
 (0)