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

Payments Filter not working #608

Closed
dadiorchen opened this issue Mar 30, 2022 · 6 comments · Fixed by #609 or #937
Closed

Payments Filter not working #608

dadiorchen opened this issue Mar 30, 2022 · 6 comments · Fixed by #609 or #937
Labels
good first issue Good for newcomers size: small Simple change tool: Earnings Relates to the Earnings tool (formerly Payments) type: bug Something isn't working

Comments

@dadiorchen
Copy link
Collaborator

Refer to Greenstand/treetracker-admin-api#629

@dadiorchen dadiorchen transferred this issue from Greenstand/treetracker-admin-api Mar 30, 2022
@dadiorchen dadiorchen mentioned this issue Mar 30, 2022
6 tasks
@dadiorchen dadiorchen reopened this Mar 30, 2022
@dadiorchen dadiorchen moved this from Done to Ready for test in Earnings System Production Readiness Mar 30, 2022
@nmcharlton nmcharlton added type: bug Something isn't working tool: Earnings Relates to the Earnings tool (formerly Payments) labels Apr 3, 2022
@Tarek-Bohdima Tarek-Bohdima moved this from Ready for test to Done in Earnings System Production Readiness Apr 7, 2022
@nmcharlton
Copy link
Collaborator

@dadiorchen @Tarek-Bohdima Can this be closed? It appears to be working in production.

@Tarek-Bohdima
Copy link
Member

@nmcharlton the payment filter problem in #629 was closed as duplicate and kept here, but it is not resolved yet as i tested it now.
Problem : in Payments :
Steps to reproduce:

  • Click on Filter
  • Organization : choose any one
  • Apply -> keep loading and nothing shows
  • Click on Filter again
  • Reset -> Nothing happens
  • Refresh page is the only solution

@nmcharlton nmcharlton changed the title Problem with reset button Payments Filter not working Jul 2, 2022
@nmcharlton
Copy link
Collaborator

Thanks @Tarek-Bohdima

It looks like pressing Apply or Reset in the filter adds unsupported parameters to the API query (GET https://test-k8s.treetracker.org/earnings/earnings), triggering a 422 error (Unprocessable Entity):

offset: 0
sort_by: calculated_at
order: desc
limit: 20
earnings_status: all
organization_id: 80                                     <-- Not allowed by API
grower:                                                 <-- Can't be empty, should be omitted
payment_status: all                                     <-- Not allowed by API
phone:                                                  <-- Can't be empty, should be omitted
sub_organization: df12ea71-65e6-4059-b4f5-60c675764497

We should also handle the error more gracefully so the user isn't left waiting for something to happen (see #718 for a similar bug in the Earnings tool).

@tranquanghuy0801
Copy link
Member

@nmcharlton if organization_id field is not allow by API, does that mean we should remove that field in Payment Filters?

@nmcharlton
Copy link
Collaborator

@nmcharlton if organization_id field is not allow by API, does that mean we should remove that field in Payment Filters?

Yes. The API instead uses sub_organization to filter by org.

@thawansilva
Copy link

Hello, I am Thawan, I would like to work on this issue!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers size: small Simple change tool: Earnings Relates to the Earnings tool (formerly Payments) type: bug Something isn't working
Projects
No open projects
5 participants