rename repository to server repository in server context

This commit is contained in:
2025-03-27 10:38:02 -07:00
parent bba00eb067
commit bda46d6808
18 changed files with 128 additions and 148 deletions

View File

@@ -4,7 +4,7 @@ import { ServerContext } from "../ServerContext";
export const RouteResolvers: Resolvers<ServerContext> = {
Route: {
shuttles: async (parent, args, contextValue, info) => {
const shuttles = await contextValue.repository.getShuttlesByRouteId(parent.id);
const shuttles = await contextValue.shuttleRepository.getShuttlesByRouteId(parent.id);
return shuttles.map(({
coordinates,
@@ -22,10 +22,10 @@ export const RouteResolvers: Resolvers<ServerContext> = {
},
orderedStop: async (parent, args, contextValue, info) => {
if (!args.forStopId) return null;
const orderedStop = await contextValue.repository.getOrderedStopByRouteAndStopId(parent.id, args.forStopId);
const orderedStop = await contextValue.shuttleRepository.getOrderedStopByRouteAndStopId(parent.id, args.forStopId);
if (!orderedStop) return null;
const stop = await contextValue.repository.getStopById(orderedStop.stopId);
const stop = await contextValue.shuttleRepository.getStopById(orderedStop.stopId);
if (!stop) return null;
return {