From b57d035f7fcadabd7d2f8f3db4f3063183b41bd8 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 18 Dec 2024 15:39:37 +1100 Subject: [PATCH] Fix for table update (#8698) (#8699) - Retain data when updating a single record - Fixes https://github.com/inventree/InvenTree/issues/8693 (cherry picked from commit 1910612725b3db8b42b014dbf5f13d86dce0f059) Co-authored-by: Oliver --- src/frontend/src/hooks/UseTable.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/frontend/src/hooks/UseTable.tsx b/src/frontend/src/hooks/UseTable.tsx index 49cc59ffa9..930968aabf 100644 --- a/src/frontend/src/hooks/UseTable.tsx +++ b/src/frontend/src/hooks/UseTable.tsx @@ -167,7 +167,10 @@ export function useTable(tableName: string): TableState { const index = _records.findIndex((r) => r.pk === record.pk); if (index >= 0) { - _records[index] = record; + _records[index] = { + ..._records[index], + ...record + }; } else { _records.push(record); }