Skip to content

Commit a915feb

Browse files
committed
fix: handle virtual columns in saveRecord function to prevent empty values
1 parent 4de0654 commit a915feb

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

adminforth/spa/src/views/EditView.vue

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,11 @@ async function saveRecord() {
150150
let columnIsUpdated = record.value[key] !== coreStore.record[key];
151151
152152
const column = coreStore.resource.columns.find((c) => c.name === key);
153+
154+
if (column?.virtual && record.value[key] === '') {
155+
continue;
156+
}
157+
153158
if (column?.foreignResource) {
154159
columnIsUpdated = record.value[key] !== coreStore.record[key]?.pk;
155160
}

0 commit comments

Comments
 (0)