Fix location dropdowns silently truncating at the 100-row backend cap
The backend clamps perpage to MAX_PAGE_SIZE (100), so location selectors that requested a large page received only the first page and still got a 200. Late-alphabet locations (past ~C5W) simply went missing from every module's dropdown, and no error surfaced. Add locationsApi.listAll, which pages through the full set via fetchAllPages, matching the established machines/printers pattern, and switch every location selector consumer to it.
This commit is contained in:
@@ -273,6 +273,12 @@ export const locationsApi = {
|
||||
list(params = {}) {
|
||||
return api.get('/locations', { params })
|
||||
},
|
||||
// Every location, paged past the backend's 100-row cap. Location selector
|
||||
// dropdowns must use this: list() with a large perpage is clamped to 100 and
|
||||
// still returns a success response, so the tail simply goes missing.
|
||||
listAll(params = {}) {
|
||||
return fetchAllPages('/locations', params)
|
||||
},
|
||||
get(id) {
|
||||
return api.get(`/locations/${id}`)
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user