Display DNS deployment URLs in overview section #21

Merged
nabarun merged 6 commits from iv-disable-deploy-button into main 2024-10-30 13:11:05 +00:00
2 changed files with 8 additions and 3 deletions
Showing only changes of commit 7b974b7f6b - Show all commits

View File

@ -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 (

View File

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