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

GetOrdersByCustomerId Bug #188

Open
dualtime opened this issue Feb 28, 2019 · 3 comments
Open

GetOrdersByCustomerId Bug #188

dualtime opened this issue Feb 28, 2019 · 3 comments

Comments

@dualtime
Copy link

In OrdersController on the action GetOrdersByCustomerId I wasn’t get the anything when I was invoking the api. So I put breakpoints on the action, then I conclude that customerId was always 0. Because of [Route("/api/orders/customer/{customer_id}")] the customerId parameter is always 0.
So, changing to [Route("/api/orders/customer/{customerId}")], now I can invoke the api and customerId is properly filed. The action now returns the orders of one specify customerId.
My question is, anyone get this problem or I am doing something wrong? And there is a better way to solve this problem?
If anyone can use this action of this controller without any problems, can you tell me how you are doing the API call, so I can see what I am doing wrong.

@Codefans-fan
Copy link

I also get this problem, to fix it i think need change customer_id to customerId

@tommymh
Copy link

tommymh commented Mar 11, 2019

I can also reproduce. I believe Codefans-fan is correct that customerId would be more semantically in line with the rest of the codebase and opened a pull request to fix.

#190

@ciaranj
Copy link

ciaranj commented Sep 16, 2020

If you don't want to fix the API, the following alternative works: /api/orders?customer_id=<customer_id>

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

4 participants