mirror of
https://github.com/brendan-ch/project-inter-server.git
synced 2026-04-17 07:50:31 +00:00
rename repository to server repository in server context
This commit is contained in:
@@ -5,7 +5,7 @@ export const ShuttleResolvers: Resolvers<ServerContext> = {
|
||||
Shuttle: {
|
||||
eta: async (parent, args, contextValue, info) => {
|
||||
if (!args.forStopId) return null;
|
||||
const etaForStopId = await contextValue.repository.getEtaForShuttleAndStopId(parent.id, args.forStopId);
|
||||
const etaForStopId = await contextValue.shuttleRepository.getEtaForShuttleAndStopId(parent.id, args.forStopId);
|
||||
if (etaForStopId === null) return null;
|
||||
|
||||
return {
|
||||
@@ -16,7 +16,7 @@ export const ShuttleResolvers: Resolvers<ServerContext> = {
|
||||
};
|
||||
},
|
||||
etas: async (parent, args, contextValue, info) => {
|
||||
const etasForShuttle = await contextValue.repository.getEtasForShuttleId(parent.id);
|
||||
const etasForShuttle = await contextValue.shuttleRepository.getEtasForShuttleId(parent.id);
|
||||
if (!etasForShuttle) return null;
|
||||
|
||||
const computedEtas = await Promise.all(etasForShuttle.map(async ({
|
||||
@@ -38,7 +38,7 @@ export const ShuttleResolvers: Resolvers<ServerContext> = {
|
||||
return [];
|
||||
},
|
||||
route: async (parent, args, contextValue, info) => {
|
||||
const route = await contextValue.repository.getRouteById(parent.routeId);
|
||||
const route = await contextValue.shuttleRepository.getRouteById(parent.routeId);
|
||||
if (route === null) return null;
|
||||
|
||||
return {
|
||||
@@ -49,4 +49,4 @@ export const ShuttleResolvers: Resolvers<ServerContext> = {
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user