From ee25ae5f4f57279fff69a74a49edd40ea9ca8077 Mon Sep 17 00:00:00 2001 From: Jake Kasper Date: Sun, 24 Aug 2025 14:30:06 -0400 Subject: [PATCH] notes --- backend/src/utils/validation.js | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/backend/src/utils/validation.js b/backend/src/utils/validation.js index 78cd973..6d0c35b 100644 --- a/backend/src/utils/validation.js +++ b/backend/src/utils/validation.js @@ -93,10 +93,19 @@ const userProductSchema = Joi.object({ Joi.object({ id: Joi.number().optional(), // For frontend temporary IDs spreaderBrand: Joi.string().max(100).required(), - spreaderModel: Joi.string().max(100).allow(null, '').optional(), + spreaderModel: Joi.alternatives().try( + Joi.string().max(100).allow(''), + Joi.allow(null) + ).optional(), settingValue: Joi.string().max(20).required(), - rateDescription: Joi.string().max(200).allow(null, '').optional(), - notes: Joi.string().allow(null, '').optional() + rateDescription: Joi.alternatives().try( + Joi.string().max(200).allow(''), + Joi.allow(null) + ).optional(), + notes: Joi.alternatives().try( + Joi.string().allow(''), + Joi.allow(null) + ).optional() }) ).optional() });