MCPcopy Create free account
hub / github.com/CodeFox-Repo/codefox / getProjectById

Method getProjectById

backend/src/project/project.service.ts:89–110  ·  view source on GitHub ↗
(projectId: string)

Source from the content-addressed store, hash-verified

87 // Create a new Promise that resolves to filtered chats
88 project.chats = Promise.resolve(
89 chats.filter((chat) => !chat.isDeleted),
90 );
91 }
92 }),
93 );
94 }
95
96 return projects.length > 0 ? projects : [];
97 }
98
99 async getProjectById(projectId: string): Promise<Project> {
100 const project = await this.projectsRepository.findOne({
101 where: { id: projectId, isDeleted: false },
102 relations: ['chats', 'user'],
103 });
104
105 if (!project) {
106 throw new NotFoundException(`Project with ID ${projectId} not found.`);
107 }
108
109 if (project.chats) {
110 const chats = await project.chats;
111 this.logger.log('Project chats:', chats);
112 project.chats = Promise.resolve(chats.filter((chat) => !chat.isDeleted));
113 }

Callers 9

subscribeToProjectMethod · 0.95
updateProjectPhotoUrlMethod · 0.95
forkProjectMethod · 0.95
createProjectZipMethod · 0.95
getProjectMethod · 0.80
getUserMethod · 0.80
getChatsMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected