From 33b8af160500817926b4d76ed3683b0f9fb4ee9b Mon Sep 17 00:00:00 2001 From: pavlovicnemanja Date: Wed, 6 Nov 2024 22:06:50 +0100 Subject: [PATCH] fix(sorting): Fixed issue with sorting in content lists --- client/components/ContentLists/Manual/Manual.jsx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/client/components/ContentLists/Manual/Manual.jsx b/client/components/ContentLists/Manual/Manual.jsx index 076342a..0e53aa3 100644 --- a/client/components/ContentLists/Manual/Manual.jsx +++ b/client/components/ContentLists/Manual/Manual.jsx @@ -511,7 +511,13 @@ class Manual extends React.Component { let changesRecord = [...this.state.changesRecord]; changesRecord = changesRecord.map((change) => { if (change.content_id === item_id) { + let index = list.items.findIndex((item) => { + let itemId = item.content ? item.content.id : item.id; + return itemId === item_id; + }); + change.content_id = res.id; + list.items[index].id = res.id; } return change; });