Respond to PR comments.
This commit is contained in:
parent
3c18cf7c34
commit
1704d0e69f
1 changed files with 2 additions and 1 deletions
|
@ -29,6 +29,7 @@ import sdk from "../../../sdk"
|
||||||
import { jsonFromCsvString } from "../../../utilities/csv"
|
import { jsonFromCsvString } from "../../../utilities/csv"
|
||||||
import { builderSocket } from "../../../websockets"
|
import { builderSocket } from "../../../websockets"
|
||||||
import { cloneDeep, isEqual } from "lodash"
|
import { cloneDeep, isEqual } from "lodash"
|
||||||
|
import { helpers } from "@budibase/shared-core"
|
||||||
|
|
||||||
function pickApi({ tableId, table }: { tableId?: string; table?: Table }) {
|
function pickApi({ tableId, table }: { tableId?: string; table?: Table }) {
|
||||||
if (table && isExternalTable(table)) {
|
if (table && isExternalTable(table)) {
|
||||||
|
@ -45,7 +46,7 @@ function checkDefaultFields(table: Table) {
|
||||||
if (!("default" in field) || field.default == null) {
|
if (!("default" in field) || field.default == null) {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
if (field.constraints?.presence) {
|
if (helpers.schema.isRequired(field)) {
|
||||||
throw new HTTPError(
|
throw new HTTPError(
|
||||||
`Cannot make field "${key}" required, it has a default value.`,
|
`Cannot make field "${key}" required, it has a default value.`,
|
||||||
400
|
400
|
||||||
|
|
Loading…
Reference in a new issue