I am trying to update many entities using adapter.updateMany()
.
I have Groups
entity that looks like this (There are multiple groups with multiple children):
{
"id": 1,
"children": [
{
"id": 222,
"width": null,
"height": null,
...multipleOtherProperties
}
]
}
I am trying to update child
width and height inside the group with:
const groups = [
{
"id": 0,
"children": [
{
"id": 222,
"groupId": 0,
"width": 400,
"height": 368.28125
}
]
}
]
But when I use:
on(GroupsActions.updateGroups, (state, { groups }) =>
adapter.updateMany(groups, state)
)
Nothing is happening and when I change updateMany
to upsertMany
on(GroupsActions.updateGroups, (state, { groups }) =>
adapter.upsertMany(groups, state)
)
Children are replaced and I am losing all the properties which are not part of the update. How to update the properties of children without removing all other properties?
Any help would be appreciated. Thank you