Skip to content

Commit 2738fd8

Browse files
committed
fix: prevent setting default value for JSON columns when not shown in create mode
1 parent 87aff58 commit 2738fd8

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

adminforth/spa/src/components/ResourceForm.vue

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,9 @@ onMounted(() => {
308308
if (column.type === 'json' && currentValues.value) {
309309
if (column.isArray?.enabled) {
310310
// if value is null or undefined, we should set it to empty array
311+
if (column.showIn?.create === false) {
312+
return;
313+
}
311314
if (!currentValues.value[column.name]) {
312315
currentValues.value[column.name] = [];
313316
} else {

0 commit comments

Comments
 (0)