mirror of
https://github.com/directus/directus.git
synced 2026-04-25 03:00:53 -04:00
fix items not getting matched properly (#7666)
This commit is contained in:
@@ -82,7 +82,10 @@ export default function usePreview(
|
||||
// Replace existing items with it's updated counterparts
|
||||
responseData = responseData
|
||||
.map((item) => {
|
||||
const updatedItem = updatedItems.find((updated) => updated[junctionPkField] === item[junctionPkField]);
|
||||
const updatedItem = updatedItems.find(
|
||||
(updated) =>
|
||||
get(updated, [junctionField, junctionPkField]) === get(item, [junctionField, junctionPkField])
|
||||
);
|
||||
if (updatedItem !== undefined) return merge(item, updatedItem);
|
||||
return item;
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user