mirror of
https://github.com/brendan-ch/project-inter-server.git
synced 2026-04-17 07:50:31 +00:00
Update resolvers to use the ETA repository
This commit is contained in:
@@ -9,7 +9,7 @@ export const ShuttleResolvers: Resolvers<ServerContext> = {
|
||||
const system = contextValue.findSystemById(parent.systemId);
|
||||
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;
|
||||
|
||||
return {
|
||||
@@ -25,7 +25,7 @@ export const ShuttleResolvers: Resolvers<ServerContext> = {
|
||||
const system = contextValue.findSystemById(parent.systemId);
|
||||
if (!system) return null;
|
||||
|
||||
const etasForShuttle = await system.shuttleRepository.getEtasForShuttleId(parent.id);
|
||||
const etasForShuttle = await system.etaRepository.getEtasForShuttleId(parent.id);
|
||||
if (!etasForShuttle) return null;
|
||||
|
||||
const computedEtas = await Promise.all(
|
||||
|
||||
@@ -16,7 +16,7 @@ export const StopResolvers: Resolvers<ServerContext> = {
|
||||
if (!system) {
|
||||
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);
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user