Juan Gabriel Palarpalar
02/16/2022, 5:39 PMPreferences {
id
...
}
Clients {
id
...
}
clientPreferences {
id
clientId
preferenceId
}
Now, a preference can be attached/detached to multiple clients. My question is how will I update existing record in clientPreferences
and at the same time, add a record if it doesn’t exist? My HTTP endpoint for this is
PATCH /preferences/:id
with the JSON request body of
{
"clientIds": [
1,
2,
3
]
}