Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to set array of object as parameters using customGET ? #1477

Closed
ridoansaleh opened this issue Sep 25, 2017 · 0 comments
Closed

How to set array of object as parameters using customGET ? #1477

ridoansaleh opened this issue Sep 25, 2017 · 0 comments

Comments

@ridoansaleh
Copy link

ridoansaleh commented Sep 25, 2017

I have an object which contains an array as one of its property.

var filter = {
  category: 1,
  page: 1,
  product: 20,
  price_range: ['bt', 1, 150]
}

Then in the service to get data

getRawList: function(filter) {
  return rawProducts.customGET("",{
    category: filter.category,
    page: filter.page,
    page_size: filter.page_size,
    'price_range[]': filter.range_price,
    shipping: filter.shipping,
    color:filter.color,
    brands: filter.brands
  }).then(function successCallback(response) {
    response.category = filter.category;
    return response;
  }, function errorCallback(response){
    console.log(response);
  });
}

It doesn't display an error AND it doesn't display the correct data as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant