1
0
Fork 0
mirror of synced 2024-10-04 03:54:37 +13:00

Convert array string to array type

This commit is contained in:
Mel O'Hagan 2022-05-30 12:05:25 +01:00
parent 9a09151d09
commit d0dffb896b

View file

@ -64,6 +64,9 @@ exports.validate = async ({ tableId, row, table }) => {
// Validate.js doesn't seem to handle array
if (type === FieldTypes.ARRAY && row[fieldName]) {
if (row[fieldName].length) {
if (!Array.isArray(row[fieldName])) {
row[fieldName] = row[fieldName].split(",")
}
row[fieldName].map(val => {
if (
!constraints.inclusion.includes(val) &&