I have the following question:
I have a “product” from a large object which I get via an API into the frontend. If I want to update this “product”. But not the complete object should be sent to the backend via the API, only the changed values should be sent – of course in the same structure:
Example:
product: {
name: "Product Name",
price: {
netPrice: 100,
currency: "$"
},
properties: {
a: "Prop A",
b: "Prop B",
c: "Prop C"
}
}
When I just update one property I want an object like this and not the complete object with the changed data (only one value changed):
product: {
properties: {
b: "Prop D"
}
}
UPDATE:
I’m using vue and want to update the object with an form
Is there any best practice for this?