Display DNS deployment URLs in overview section #21
@ -22,8 +22,8 @@ export const createResolvers = async (service: Service): Promise<any> => {
|
||||
return service.getOrganizationsByUserId(context.user);
|
||||
},
|
||||
|
||||
project: async (_: any, { projectId }: { projectId: string }) => {
|
||||
return service.getProjectById(projectId);
|
||||
project: async (_: any, { projectId }: { projectId: string }, context: any) => {
|
||||
return service.getProjectById(context.user, projectId);
|
||||
},
|
||||
|
||||
projectsInOrganization: async (
|
||||
|
@ -407,8 +407,13 @@ export class Service {
|
||||
return dbOrganizations;
|
||||
}
|
||||
|
||||
async getProjectById(projectId: string): Promise<Project | null> {
|
||||
async getProjectById(user: User, projectId: string): Promise<Project | null> {
|
||||
const dbProject = await this.db.getProjectById(projectId);
|
||||
|
||||
if (dbProject && dbProject.owner.id !== user.id) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return dbProject;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user