Skip to content

OBGM-492 Invalid content of stocklist dropdown on request create page#4103

Merged
kchelstowski merged 2 commits intofeature/upgrade-to-grails-3.3.10from
OBGM-492
Jun 14, 2023
Merged

OBGM-492 Invalid content of stocklist dropdown on request create page#4103
kchelstowski merged 2 commits intofeature/upgrade-to-grails-3.3.10from
OBGM-492

Conversation

@alannadolny
Copy link
Collaborator

No description provided.

fetchStockLists(origin, destination, clearStocklist) {
this.props.showSpinner();
const url = `/api/stocklists?origin.id=${origin.id}&destination.id=${destination.id}`;
const url = `/api/stocklists?origin=${origin.id}&destination=${destination.id}`;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about starting to refactor the hard-coded urls to our urls factory whenever we have to "touch" them?
So to use here:

return apiClient.get(STOCKLIST_API, { 
  params: {
    origin: origin.id,
    destination: destination.id,
  },
})

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm nervous about removing the ".id" part of the parameter name without understanding what the underlying issue is. It's one thing if this was an isolated issue, but it feels like this is going to be the start of a very uncomfortable refactoring.

If you have further information on why this is necessary, please add your investigation to the ticket. Otherwise we're going to have to turn this issue into a spike to figure out the extent of the problem.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jmiranda I would not be nervous, because it seems like this issue was once solved on Grails 1 as well, but just got lost somewhere while rebasing.
Currently on Grails 1 we don't have origin.id being used, but origin, like:

const url = `/openboxes/api/stocklists?origin=${origin.id}&destination=${destination.id}`;

Commit where it was fixed: 65a3859
and the PR: #3498
Feels like @awalkowiak was the one fixing it on Grails 1

cc @alannadolny

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kchelstowski I changed the hard-coded URL as u proposed.

@alannadolny alannadolny requested a review from kchelstowski June 14, 2023 11:19
@kchelstowski kchelstowski merged commit a86f128 into feature/upgrade-to-grails-3.3.10 Jun 14, 2023
@kchelstowski kchelstowski deleted the OBGM-492 branch June 14, 2023 16:24
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

Successfully merging this pull request may close these issues.

3 participants