Not the easiest issue to put into a title.
Anyhow, my app is built on nodejs
/expressjs
and has an API set up for the url:
EDIT: The current code I'm using is:
$scope.updateProduct = $resource('/api/updateProduct/:product/:param/:value',{},{
query: {method:'GET'},
post: {method:'POST'},
save: {method:'PUT', params: {brand: '@brand', param:'@param', value:'@value'}},
remove: {method:'DELETE'}
});
$scope.updateProduct.save({
product : $scope.post._id,
param: 'likes',
value: $scope.user._id
});
At present it calls /api/updateProduct
instead of /api/updateProduct/<product>/<param>/<value>
like it's supposed to / like it does when I perform $scope.updateProduct.get()
.
In my console I see (as an example):
PUT /api/updateBrand/Quay%20Eyewear%20Australia/userTags/sunglasses,%20classic 200 30ms - 2.31kb
However, the API isn't actually accessed/nothing happens. Interestingly, if I go to localhost:5000/api/updateBrand/Quay%20Eyewear%20Australia/userTags/sunglasses,%20classic
in my browser, it posts the correct data and updates the product in my database, so it's definitely an error with the way the $resource
is being called.