Closed soleanos closed 6 years ago
The problem is that you are adding an item without an id. All entities must have an id. When the library sees that the entity-to-add lacks an id, it assumes that you want the server to generate one for you. It will try if it can determine the type of the id from other entities in the collection. But because there aren't any, it gives up.
In future we may have some metadata to guide it. Right now the solution is to provide a custom genId()
function as explained in the README.
Closing because that's the prescribed solution for now.
@wardbell what if I want send POST FormData. That doesnt have id
Hi, I'v an issue about adding new items to an empty collection : i get the error : "Collection 'stories' id type is non-numeric or unknown. Can only generate numeric ids."}"
status:422 statusText:"Unprocessable Entity" url:"api/stories"
This work fine when i'v one item or more but after deleting all items of the collection this error happen.. any ideas ?
Thanks