In the example below, the setHasManyItem and updateHasManyItem helpers cannot be used to remove values from relationTypes.
{
_id: 'contact0',
name: 'Alice',
relationships: {
related: {
data: [
{
_id: 'related0',
metadata: {
relationTypes: ['spouse', 'friend']
}
}
]
}
}
}
At issue are two merges here and there in setHasManyItem.
The documentation shows a manual approach.
We already got around the problem here cozy-contacts.
PS: Another subject, but we've encountered a similar problem with the cozy-client store.
Both approaches assume that the value passed as an argument is not up to date with the original document.
Maybe it would be a good idea to review the approach? 🤔
In the example below, the setHasManyItem and updateHasManyItem helpers cannot be used to remove values from
relationTypes.At issue are two merges here and there in
setHasManyItem.The documentation shows a manual approach.
We already got around the problem here cozy-contacts.
PS: Another subject, but we've encountered a similar problem with the cozy-client store.
Both approaches assume that the value passed as an argument is not up to date with the original document.
Maybe it would be a good idea to review the approach? 🤔