From 59eb04364fa971074dc693eccc6cb880d5769952 Mon Sep 17 00:00:00 2001 From: Aditya Sridhar Date: Wed, 16 Oct 2024 18:34:44 -0400 Subject: [PATCH] fix: ensure picklist values are formatted correctly prior to comparison --- packages/server/src/arpa_reporter/services/validate-upload.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/server/src/arpa_reporter/services/validate-upload.js b/packages/server/src/arpa_reporter/services/validate-upload.js index 85225b0b5..dea7dd081 100644 --- a/packages/server/src/arpa_reporter/services/validate-upload.js +++ b/packages/server/src/arpa_reporter/services/validate-upload.js @@ -326,9 +326,9 @@ async function validateRecord({ upload, record, typeRules: rules }) { const lcItems = rule.listVals.map((val) => multiselect(val.toLowerCase())); // for pick lists, the value must be one of possible values - if (rule.dataType === 'Pick List' && !lcItems.includes(value)) { + if (rule.dataType === 'Pick List' && !lcItems.includes(multiselect(value))) { errors.push(new ValidationError( - `Value for ${key} ('${value}') must be one of ${lcItems.length} options in the input template`, + `Value for ${key} ('${value}') must be one of ${lcItems.length} ${JSON.stringify(lcItems)}options in the input template`, { col: rule.columnName, severity: 'err' }, )); }