mirror of
https://github.com/directus/directus.git
synced 2026-01-29 16:28:02 -05:00
Save old relations as patches
This commit is contained in:
@@ -213,7 +213,15 @@ export default defineComponent({
|
||||
})
|
||||
);
|
||||
|
||||
await api.post(`/relations`, state.relations);
|
||||
await Promise.all(
|
||||
state.relations.map((relation: Partial<Relation>) => {
|
||||
if (relation.id) {
|
||||
return api.patch(`/relations/${relation.id}`, relation);
|
||||
} else {
|
||||
return api.post(`/relations`, relation);
|
||||
}
|
||||
})
|
||||
);
|
||||
|
||||
router.push(`/settings/data-model/${props.collection}`);
|
||||
clearLocalStore();
|
||||
|
||||
Reference in New Issue
Block a user