Hello SmartStore Community,
I'm in the process of importing existing data into SmartStore. I try to use the odata WebApi as much as possible (instead of 'manually' executing queries on the SmartStore DB). The customers and addresses are already imported so they only need to be linked. For products there are some handy shortcuts as I've seen in the documentation: http://docs.smartsto...roduct Examples . It seems there is no such 'navigation link' for the addresses of a customer.
What I have tried is patching an existing customer and pass a list of Address IDs, like I've seen in the odata tutorial http://www.odata.org...utorial/#update For example, I want to assing addresses with IDs 1 and 2 to a customer with ID 1. The following doesn't seem to work. I get an error containing "An unexpected 'PrimitiveValue' node was found when reading from the JSON reader".
PATCH urlbase/odata/v1/Customers(1) { "Addresses" : [1,2] }
This way of patching works with 'normal' properties.
I also tried to pass the addresses as JSON objects (containing only the address ID as property), but then I receive another error 'Cannot apply PATCH to navigation property'. It would be nice if someone could provide a sample update request for addresses of a customer.
Thanks in advance