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,
@@ -65,10 +65,12 @@
65
65
  label: string;
66
66
  components?: {
67
67
  show?: {
68
- meta: Record<string, any>;
68
+ file: string;
69
+ meta: Record<string, any>;
69
70
  };
70
71
  showRow?: {
71
- meta: Record<string, any>;
72
+ file: string;
73
+ meta: Record<string, any>;
72
74
  };
73
75
  };
74
76
  }>;
@@ -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
- if (record.value[key] !== coreStore.record[key]) {
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
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "adminforth",
3
- "version": "1.12.1",
3
+ "version": "1.12.2-next.2",
4
4
  "description": "OpenSource Vue3 powered forth-generation admin panel",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",