use system ID provided on ordered stop to look for system

This commit is contained in:
2025-04-07 12:31:16 -07:00
parent 1e7082813d
commit a830dadbee

View File

@@ -7,8 +7,7 @@ export const OrderedStopResolvers: Resolvers<ServerContext> = {
const routeId = parent.routeId;
const stopId = parent.stopId;
if (!parent.stop) return null;
const system = contextValue.findSystemById(parent.stop.systemId);
const system = contextValue.findSystemById(parent.systemId);
if (!system) return null;
const currentOrderedStop = await system.shuttleRepository.getOrderedStopByRouteAndStopId(routeId, stopId);
@@ -31,8 +30,7 @@ export const OrderedStopResolvers: Resolvers<ServerContext> = {
const routeId = parent.routeId;
const stopId = parent.stopId;
if (!parent.stop) return null;
const system = contextValue.findSystemById(parent.stop.systemId);
const system = contextValue.findSystemById(parent.systemId);
if (!system) return null;
const currentOrderedStop = await system.shuttleRepository.getOrderedStopByRouteAndStopId(routeId, stopId);
@@ -52,15 +50,13 @@ export const OrderedStopResolvers: Resolvers<ServerContext> = {
}
},
stop: async (parent, args, contextValue, _info) => {
if (!parent.stop) return null;
const system = contextValue.findSystemById(parent.stop.systemId);
const system = contextValue.findSystemById(parent.systemId);
if (!system) return null;
return await system.shuttleRepository.getStopById(parent.stopId);
},
route: async (parent, args, contextValue, _info) => {
if (!parent.stop) return null;
const system = contextValue.findSystemById(parent.stop.systemId);
const system = contextValue.findSystemById(parent.systemId);
if (!system) return null;
return await system.shuttleRepository.getRouteById(parent.routeId);