mirror of
https://github.com/inventree/InvenTree.git
synced 2025-04-28 11:36:44 +00:00
Fix for table update (#8698)
- Retain data when updating a single record - Fixes https://github.com/inventree/InvenTree/issues/8693
This commit is contained in:
parent
9f1d1abd5b
commit
1910612725
@ -167,7 +167,10 @@ export function useTable(tableName: string): TableState {
|
|||||||
const index = _records.findIndex((r) => r.pk === record.pk);
|
const index = _records.findIndex((r) => r.pk === record.pk);
|
||||||
|
|
||||||
if (index >= 0) {
|
if (index >= 0) {
|
||||||
_records[index] = record;
|
_records[index] = {
|
||||||
|
..._records[index],
|
||||||
|
...record
|
||||||
|
};
|
||||||
} else {
|
} else {
|
||||||
_records.push(record);
|
_records.push(record);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user