Update resolvers to use the ETA repository

This commit is contained in:
2025-11-11 15:30:52 -08:00
parent 90041555a9
commit fd59f6cbd9
2 changed files with 3 additions and 3 deletions

View File

@@ -9,7 +9,7 @@ export const ShuttleResolvers: Resolvers<ServerContext> = {
const system = contextValue.findSystemById(parent.systemId); const system = contextValue.findSystemById(parent.systemId);
if (!system) return null; if (!system) return null;
const etaForStopId = await system.shuttleRepository.getEtaForShuttleAndStopId(parent.id, args.forStopId); const etaForStopId = await system.etaRepository.getEtaForShuttleAndStopId(parent.id, args.forStopId);
if (etaForStopId === null) return null; if (etaForStopId === null) return null;
return { return {
@@ -25,7 +25,7 @@ export const ShuttleResolvers: Resolvers<ServerContext> = {
const system = contextValue.findSystemById(parent.systemId); const system = contextValue.findSystemById(parent.systemId);
if (!system) return null; if (!system) return null;
const etasForShuttle = await system.shuttleRepository.getEtasForShuttleId(parent.id); const etasForShuttle = await system.etaRepository.getEtasForShuttleId(parent.id);
if (!etasForShuttle) return null; if (!etasForShuttle) return null;
const computedEtas = await Promise.all( const computedEtas = await Promise.all(

View File

@@ -16,7 +16,7 @@ export const StopResolvers: Resolvers<ServerContext> = {
if (!system) { if (!system) {
return []; return [];
} }
const etas = await system.shuttleRepository.getEtasForStopId(parent.id); const etas = await system.etaRepository.getEtasForStopId(parent.id);
return etas.slice().sort((a, b) => a.secondsRemaining - b.secondsRemaining); return etas.slice().sort((a, b) => a.secondsRemaining - b.secondsRemaining);
}, },
}, },