Skip to content

Commit e7544c3

Browse files
committed
Merge branch 'next' of github.com:devforth/adminforth into polymorphic
2 parents 6e9d900 + c412f75 commit e7544c3

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

adminforth/modules/restApi.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1076,7 +1076,7 @@ export default class AdminForthRestAPI implements IAdminForthRestAPI {
10761076

10771077
// for polymorphic foreign resources, we need to find out the value for polymorphicOn column
10781078
for (const column of resource.columns) {
1079-
if (column.foreignResource?.polymorphicOn) {
1079+
if (column.foreignResource?.polymorphicOn && record[column.name] !== undefined) {
10801080
let newPolymorphicOnValue = null;
10811081
if (record[column.name]) {
10821082
const targetResources = {};

adminforth/spa/src/views/EditView.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ async function saveRecord() {
145145
146146
const column = coreStore.resource.columns.find((c) => c.name === key);
147147
if (column?.foreignResource) {
148-
columnIsUpdated = record.value[key] !== coreStore.record[key].pk;
148+
columnIsUpdated = record.value[key] !== coreStore.record[key]?.pk;
149149
}
150150
151151
if (columnIsUpdated) {

0 commit comments

Comments
 (0)