mirror of
https://github.com/brendan-ch/project-inter-server.git
synced 2026-04-17 16:00:32 +00:00
reduce System.shuttles resolver to one statement
This commit is contained in:
@@ -40,14 +40,7 @@ export const SystemResolvers: Resolvers<ServerContext> = {
|
||||
return shuttle;
|
||||
},
|
||||
shuttles: async (parent, args, contextValue, info) => {
|
||||
const shuttles = await contextValue.repository.getShuttlesBySystemId(parent.id);
|
||||
|
||||
return shuttles.map(shuttle => ({
|
||||
coordinates: shuttle.coordinates,
|
||||
name: shuttle.name,
|
||||
id: shuttle.id,
|
||||
routeId: shuttle.routeId,
|
||||
}));
|
||||
return await contextValue.repository.getShuttlesBySystemId(parent.id);
|
||||
}
|
||||
},
|
||||
}
|
||||
Reference in New Issue
Block a user