I've developed a straightforward $resource
factory.
.factory('Order', order)
order.$inject = ['$resource', "ApiEndpoint", "UserRecord"];
function order($resource, ApiEndpoint, UserRecord) {
return $resource(ApiEndpoint.url + 'orders.json', {}, {
create: {method: 'POST', url: ApiEndpoint.url + 'orders.json'}
});
}
Here's the snippet of code I'm executing.
var params = {product_id: 32342, variant_id: 536341};
Order.create(params, function( resp ) {
console.log("success");
});
Whenever I trigger the create
function, the parameters aren't being passed through. None of the parameters are getting through. What could be causing this issue and how can I resolve it?