mirror of
https://github.com/brendan-ch/project-inter-server.git
synced 2026-04-17 07:50:31 +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;
|
return shuttle;
|
||||||
},
|
},
|
||||||
shuttles: async (parent, args, contextValue, info) => {
|
shuttles: async (parent, args, contextValue, info) => {
|
||||||
const shuttles = await contextValue.repository.getShuttlesBySystemId(parent.id);
|
return await contextValue.repository.getShuttlesBySystemId(parent.id);
|
||||||
|
|
||||||
return shuttles.map(shuttle => ({
|
|
||||||
coordinates: shuttle.coordinates,
|
|
||||||
name: shuttle.name,
|
|
||||||
id: shuttle.id,
|
|
||||||
routeId: shuttle.routeId,
|
|
||||||
}));
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user