Set a required constraint for a column that is defaulted to being the primary display

This commit is contained in:
Andrew Kingston 2022-03-21 09:44:24 +00:00
parent 69532f59ce
commit a80fe7d7d8
1 changed files with 7 additions and 1 deletions

View File

@ -12,7 +12,7 @@
Modal, Modal,
notifications, notifications,
} from "@budibase/bbui" } from "@budibase/bbui"
import { createEventDispatcher } from "svelte" import { createEventDispatcher, onMount } from "svelte"
import { cloneDeep } from "lodash/fp" import { cloneDeep } from "lodash/fp"
import { tables } from "stores/backend" import { tables } from "stores/backend"
import { TableNames, UNEDITABLE_USER_FIELDS } from "constants" import { TableNames, UNEDITABLE_USER_FIELDS } from "constants"
@ -321,6 +321,12 @@
} }
return newError return newError
} }
onMount(() => {
if (primaryDisplay) {
field.constraints.presence = { allowEmpty: false }
}
})
</script> </script>
<ModalContent <ModalContent