mirror of
https://github.com/brendan-ch/project-inter-server.git
synced 2026-04-17 07:50:31 +00:00
use system ID provided on ordered stop to look for system
This commit is contained in:
@@ -7,8 +7,7 @@ export const OrderedStopResolvers: Resolvers<ServerContext> = {
|
|||||||
const routeId = parent.routeId;
|
const routeId = parent.routeId;
|
||||||
const stopId = parent.stopId;
|
const stopId = parent.stopId;
|
||||||
|
|
||||||
if (!parent.stop) return null;
|
const system = contextValue.findSystemById(parent.systemId);
|
||||||
const system = contextValue.findSystemById(parent.stop.systemId);
|
|
||||||
if (!system) return null;
|
if (!system) return null;
|
||||||
|
|
||||||
const currentOrderedStop = await system.shuttleRepository.getOrderedStopByRouteAndStopId(routeId, stopId);
|
const currentOrderedStop = await system.shuttleRepository.getOrderedStopByRouteAndStopId(routeId, stopId);
|
||||||
@@ -31,8 +30,7 @@ export const OrderedStopResolvers: Resolvers<ServerContext> = {
|
|||||||
const routeId = parent.routeId;
|
const routeId = parent.routeId;
|
||||||
const stopId = parent.stopId;
|
const stopId = parent.stopId;
|
||||||
|
|
||||||
if (!parent.stop) return null;
|
const system = contextValue.findSystemById(parent.systemId);
|
||||||
const system = contextValue.findSystemById(parent.stop.systemId);
|
|
||||||
if (!system) return null;
|
if (!system) return null;
|
||||||
|
|
||||||
const currentOrderedStop = await system.shuttleRepository.getOrderedStopByRouteAndStopId(routeId, stopId);
|
const currentOrderedStop = await system.shuttleRepository.getOrderedStopByRouteAndStopId(routeId, stopId);
|
||||||
@@ -52,15 +50,13 @@ export const OrderedStopResolvers: Resolvers<ServerContext> = {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
stop: async (parent, args, contextValue, _info) => {
|
stop: async (parent, args, contextValue, _info) => {
|
||||||
if (!parent.stop) return null;
|
const system = contextValue.findSystemById(parent.systemId);
|
||||||
const system = contextValue.findSystemById(parent.stop.systemId);
|
|
||||||
if (!system) return null;
|
if (!system) return null;
|
||||||
|
|
||||||
return await system.shuttleRepository.getStopById(parent.stopId);
|
return await system.shuttleRepository.getStopById(parent.stopId);
|
||||||
},
|
},
|
||||||
route: async (parent, args, contextValue, _info) => {
|
route: async (parent, args, contextValue, _info) => {
|
||||||
if (!parent.stop) return null;
|
const system = contextValue.findSystemById(parent.systemId);
|
||||||
const system = contextValue.findSystemById(parent.stop.systemId);
|
|
||||||
if (!system) return null;
|
if (!system) return null;
|
||||||
|
|
||||||
return await system.shuttleRepository.getRouteById(parent.routeId);
|
return await system.shuttleRepository.getRouteById(parent.routeId);
|
||||||
|
|||||||
Reference in New Issue
Block a user