mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-29 10:40:58 +00:00
paginate wagons, locomotives and routes lists server-side
This commit is contained in:
@@ -1632,17 +1632,25 @@ export const api = {
|
||||
},
|
||||
|
||||
wagons: {
|
||||
/** Every match, page-walked — for pickers and yard views. Lists use `listPaged`. */
|
||||
list: endpoint<{ filters?: WagonListFilters }, Wagon[]>(
|
||||
"wagons",
|
||||
"list",
|
||||
({ filters }) => wagonService.getAll(filters ?? {}).then((r) => r.data),
|
||||
({ filters }) => wagonService.listAll(filters ?? {}),
|
||||
({ filters }) => ["wagons", "list", filters ?? {}],
|
||||
),
|
||||
|
||||
listPaged: endpoint<{ filters?: WagonListFilters }, PaginatedResponse<Wagon>>(
|
||||
"wagons",
|
||||
"listPaged",
|
||||
({ filters }) => wagonService.getAll(filters ?? {}).then((r) => r.data),
|
||||
({ filters }) => ["wagons", "listPaged", filters ?? {}],
|
||||
),
|
||||
|
||||
listByTrain: endpoint<{ trainId: string }, Wagon[]>(
|
||||
"wagons",
|
||||
"listByTrain",
|
||||
({ trainId }) => wagonService.getByTrain(trainId).then((r) => r.data),
|
||||
({ trainId }) => wagonService.getByTrain(trainId),
|
||||
({ trainId }) => ["wagons", "train", trainId],
|
||||
),
|
||||
|
||||
|
||||
Reference in New Issue
Block a user