Open iladarsda opened 10 years ago
It seems like you're forgetting to include the model id in the restangular delete call.
I.e. it should be hitting the route http://localhost:3000/resources/:id
but its not including the id in the path.
Restangular should probably prevent something like this by throwing an error
Great tip.
It turns out my Restangular config was wrong. I've used MongoLab config as an example; i.e.
RestangularProvider.setRestangularFields({ id: '_id.$oid' });
But, my local MongoDB installation has no _id.$oid
, insted it should just read:
RestangularProvider.setRestangularFields({id: '_id'});
it needs proper url, seems like you've missed "id" surppose to be like this: export const deletePost = (id) => axios.delete(${url}/${id}
); in your API
When making a DELETE request using RESTANGULAR (AngularJS), I get
even though my model clearly states that this method is allow:
What should I check? Please advise.
Thanks