mirror of
https://github.com/rowyio/rowy.git
synced 2025-12-29 00:16:39 +01:00
fix: nested key column updating whole object
This commit is contained in:
@@ -406,6 +406,13 @@ export const updateFieldAtom = atom(
|
||||
if (isEqual(currentValue, value)) return;
|
||||
}
|
||||
// Otherwise, apply the update
|
||||
|
||||
// Check if nested path
|
||||
if (fieldName.split(".").length > 1) {
|
||||
const p = tableRows.find((r) => r._rowy_ref.path === path);
|
||||
// add the parent object
|
||||
_set(update, fieldName.split(".")[0], _get(p, fieldName.split(".")[0]));
|
||||
}
|
||||
_set(update, fieldName, value);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user