When you have a main object that includes related “addon” data, how do you structure and manage it on the frontend without ending up with a messy implementation?
Example: You fetch a Product object from your API, which already includes its Category as an addon. In your form, you need to edit the product’s details and also choose a category from a separate list you’ve fetched via another API call.
How do you handle the incoming object with its addons and track the user’s edits?
When submitting changes, do you send only the modified fields (PATCH) or the entire object ?
What is considered the most flexible best practice for this scenario?