mirror of
https://github.com/brendan-ch/project-inter-server.git
synced 2026-04-17 07:50:31 +00:00
fix incorrect stop being returned in OrderedStop nextStop receiver
This commit is contained in:
@@ -146,7 +146,10 @@ export const resolvers: Resolvers<ServerContext> = {
|
|||||||
const routeId = parent.route.id;
|
const routeId = parent.route.id;
|
||||||
const stopId = parent.stop.id;
|
const stopId = parent.stop.id;
|
||||||
|
|
||||||
const nextOrderedStop = await contextValue.repository.getOrderedStopByRouteAndStopId(routeId, stopId);
|
const currentOrderedStop = await contextValue.repository.getOrderedStopByRouteAndStopId(routeId, stopId);
|
||||||
|
if (!currentOrderedStop) return null;
|
||||||
|
|
||||||
|
const nextOrderedStop = currentOrderedStop.nextStop;
|
||||||
if (!nextOrderedStop) return null;
|
if (!nextOrderedStop) return null;
|
||||||
|
|
||||||
const nextStopObject = await contextValue.repository.getStopById(nextOrderedStop.stopId);
|
const nextStopObject = await contextValue.repository.getStopById(nextOrderedStop.stopId);
|
||||||
|
|||||||
Reference in New Issue
Block a user