Skip to content

Commit a977c2f

Browse files
authored
Merge pull request #94 from devforth/add-unset-foreign-required-check
fix: add foreign resource unset only when column is not required
2 parents 3eb0c75 + e0de9b7 commit a977c2f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

adminforth/spa/src/components/ResourceForm.vue

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -252,8 +252,10 @@ const columnOptions = computedAsync(async () => {
252252
offset: 0,
253253
},
254254
});
255-
console.log(`columnOptions for ${column.name}: ${JSON.stringify(list.items, null, 2)}`);
256-
return { [column.name]: [...list.items, { value: null, label: t('Unset')}] };
255+
256+
if (!column.required[props.source]) list.items.push({ value: null, label: t('Unset') });
257+
258+
return { [column.name]: list.items };
257259
}
258260
})
259261
)).reduce((acc, val) => Object.assign(acc, val), {})

0 commit comments

Comments
 (0)