OBGM-492 Invalid content of stocklist dropdown on request create page#4103
OBGM-492 Invalid content of stocklist dropdown on request create page#4103kchelstowski merged 2 commits intofeature/upgrade-to-grails-3.3.10from
Conversation
| 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}`; |
There was a problem hiding this comment.
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,
},
})There was a problem hiding this comment.
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.
There was a problem hiding this comment.
@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
There was a problem hiding this comment.
@kchelstowski I changed the hard-coded URL as u proposed.
No description provided.