mirror of
https://github.com/brendan-ch/project-inter-server.git
synced 2026-04-17 16:00:32 +00:00
check for system association in system resolvers
This commit is contained in:
@@ -14,6 +14,8 @@ export const SystemResolvers: Resolvers<ServerContext> = {
|
||||
const stop = await contextValue.repository.getStopById(args.id);
|
||||
if (stop === null) return null;
|
||||
|
||||
if (stop.systemId !== parent.id) return null;
|
||||
|
||||
return {
|
||||
id: stop.id,
|
||||
name: stop.name,
|
||||
@@ -25,6 +27,8 @@ export const SystemResolvers: Resolvers<ServerContext> = {
|
||||
const route = await contextValue.repository.getRouteById(args.id);
|
||||
if (route === null) return null;
|
||||
|
||||
if (route.systemId !== parent.id) return null;
|
||||
|
||||
return {
|
||||
color: route.color,
|
||||
id: route.id,
|
||||
@@ -37,6 +41,8 @@ export const SystemResolvers: Resolvers<ServerContext> = {
|
||||
const shuttle = await contextValue.repository.getShuttleById(args.id);
|
||||
if (shuttle === null) return null;
|
||||
|
||||
if (shuttle.systemId !== parent.id) return null;
|
||||
|
||||
return shuttle;
|
||||
},
|
||||
shuttles: async (parent, args, contextValue, info) => {
|
||||
|
||||
Reference in New Issue
Block a user