Closed hdrodel closed 3 years ago
Hi! you should set default identifier
in your model, some like this:
options () {
return {
identifier: '_id',
overwriteIdentifier: true,
}
}
and check the documentation options description:
I hope I had help you. :)
Thank you @eduardobc88 I thought I tried that solution before but somehow this time it worked!
Hello I'm having a weird problem. I need to be able to have a collection of models that also have model collections. I try to break it down as simple as possible: The model is Pizza My ingredient
Then a list of ingredients
Then my list of all Pizzas
So far everything seems to work. The PizzaList is fetched and has an Ingredientslist. I can open a dialog and pass a PizaItem and edit and save things. But when i try to edit an Ingredient like so: Template:
and in the script i have:
So when i call saveIngredient the correct endpoint gets called and correctly a put request is made for updating the ingredients as specified in my methods. the request has the right body content but i get this error message
I also have tried not having the ingredients collection as model attribute of the pizza but instead only have an array of ingredients and then when saving:
But it seems like it gave me the same error message
I tried to allow overwriting the identifier like mentioned in the documentation but then the endpoint for creating a model and not for updating the model is being called
does anyone know where this error occurs? where is the identifier overwritten?