reduce System.shuttles resolver to one statement

This commit is contained in:
2025-01-28 20:40:36 -08:00
parent 3fca362c14
commit 391884c91d

View File

@@ -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,
}));
} }
}, },
} }