Merge pull request #8489 from Budibase/fix/form-block-create-mode-bindings-causing-errors-when-ejected

Fix Form Block Create Mode Bindings Causing Error When Ejected
This commit is contained in:
Gerard Burns 2022-11-02 19:09:34 +00:00 committed by GitHub
commit 7801ab3b0c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 7 deletions

View File

@ -85,13 +85,8 @@
valueType: "Binding",
},
]
// If we're using an "update" form, use the real data provider. If we're
// using a create form, we just want a fake array so that our repeater
// will actually render the form, but data doesn't matter.
$: dataProvider =
actionType !== "Create"
? `{{ literal ${safe(providerId)} }}`
: { rows: [{}] }
$: dataProvider = `{{ literal ${safe(providerId)} }}`
$: renderDeleteButton = showDeleteButton && actionType === "Update"
$: renderSaveButton = showSaveButton && actionType !== "View"
$: renderButtons = renderDeleteButton || renderSaveButton