2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-04-28 11:36:44 +00:00

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 <oliver.henry.walters@gmail.com>
This commit is contained in:
github-actions[bot] 2024-12-18 15:39:37 +11:00 committed by GitHub
parent 3ac49441ca
commit b57d035f7f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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);
}