fix incorrect stop being returned in OrderedStop nextStop receiver

This commit is contained in:
2024-12-22 19:47:59 -08:00
parent c40dafc3ee
commit eb6652c290

View File

@@ -146,7 +146,10 @@ export const resolvers: Resolvers<ServerContext> = {
const routeId = parent.route.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;
const nextStopObject = await contextValue.repository.getStopById(nextOrderedStop.stopId);