Browse Source

Do not validate if multi-select options length is 0

pull/5290/head
Kacper 4 years ago
parent
commit
98a926cfca
  1. 5
      packages/server/src/api/controllers/row/utils.js

5
packages/server/src/api/controllers/row/utils.js

@ -65,7 +65,10 @@ exports.validate = async ({ tableId, row, table }) => {
if (type === FieldTypes.ARRAY && row[fieldName]) {
if (row[fieldName].length) {
row[fieldName].map(val => {
if (!constraints.inclusion.includes(val)) {
if (
!constraints.inclusion.includes(val) &&
constraints.inclusion.length !== 0
) {
errors[fieldName] = "Field not in list"
}
})

Loading…
Cancel
Save