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,14 +4,14 @@ import { ServerContext } from "../ServerContext";
export const SystemResolvers: Resolvers<ServerContext> = {
System: {
routes: async (parent, args, contextValue, info) => {
return await contextValue.repository.getRoutesBySystemId(parent.id);
return await contextValue.shuttleRepository.getRoutesBySystemId(parent.id);
},
stops: async (parent, args, contextValue, info) => {
return await contextValue.repository.getStopsBySystemId(parent.id);
return await contextValue.shuttleRepository.getStopsBySystemId(parent.id);
},
stop: async (parent, args, contextValue, info) => {
if (!args.id) return null;
const stop = await contextValue.repository.getStopById(args.id);
const stop = await contextValue.shuttleRepository.getStopById(args.id);
if (stop === null) return null;
if (stop.systemId !== parent.id) return null;
@@ -24,7 +24,7 @@ export const SystemResolvers: Resolvers<ServerContext> = {
},
route: async (parent, args, contextValue, info) => {
if (!args.id) return null;
const route = await contextValue.repository.getRouteById(args.id);
const route = await contextValue.shuttleRepository.getRouteById(args.id);
if (route === null) return null;
if (route.systemId !== parent.id) return null;
@@ -38,7 +38,7 @@ export const SystemResolvers: Resolvers<ServerContext> = {
},
shuttle: async (parent, args, contextValue, info) => {
if (!args.id) return null;
const shuttle = await contextValue.repository.getShuttleById(args.id);
const shuttle = await contextValue.shuttleRepository.getShuttleById(args.id);
if (shuttle === null) return null;
if (shuttle.systemId !== parent.id) return null;
@@ -46,7 +46,7 @@ export const SystemResolvers: Resolvers<ServerContext> = {
return shuttle;
},
shuttles: async (parent, args, contextValue, info) => {
return await contextValue.repository.getShuttlesBySystemId(parent.id);
return await contextValue.shuttleRepository.getShuttlesBySystemId(parent.id);
}
},
}
}