update parent system ID reference for ETA resolvers

This commit is contained in:
2025-04-07 12:41:27 -07:00
parent bed2fbc7c3
commit 6e9478cd18

View File

@@ -4,15 +4,13 @@ import { ServerContext } from "../ServerContext";
export const EtaResolvers: Resolvers<ServerContext> = {
ETA: {
stop: async (parent, args, contextValue, info) => {
if (!parent.shuttle) return null;
const system = contextValue.findSystemById(parent.shuttle.systemId);
const system = contextValue.findSystemById(parent.systemId);
if (!system) return null;
return await system.shuttleRepository.getStopById(parent.stopId);
},
shuttle: 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.getShuttleById(parent.shuttleId);