adminforth 1.12.1 → 1.12.2-next.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -299,7 +299,7 @@ const coreStore = useCoreStore();
|
|
|
299
299
|
const { t } = useI18n();
|
|
300
300
|
const props = defineProps<{
|
|
301
301
|
page: number,
|
|
302
|
-
resource: AdminForthResourceCommon,
|
|
302
|
+
resource: AdminForthResourceCommon | null,
|
|
303
303
|
rows: any[] | null,
|
|
304
304
|
totalRows: number,
|
|
305
305
|
pageSize: number,
|
|
@@ -141,7 +141,14 @@ async function saveRecord() {
|
|
|
141
141
|
saving.value = true;
|
|
142
142
|
const updates = {};
|
|
143
143
|
for (const key in record.value) {
|
|
144
|
-
|
|
144
|
+
let columnIsUpdated = record.value[key] !== coreStore.record[key];
|
|
145
|
+
|
|
146
|
+
const column = coreStore.resource.columns.find((c) => c.name === key);
|
|
147
|
+
if (column?.foreignResource) {
|
|
148
|
+
columnIsUpdated = record.value[key] !== coreStore.record[key].pk;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
if (columnIsUpdated) {
|
|
145
152
|
updates[key] = record.value[key];
|
|
146
153
|
}
|
|
147
154
|
}
|