added project validation

This commit is contained in:
hannathkadher
2025-02-17 23:07:15 +04:00
parent a99b759882
commit 7ddd75041e

View File

@ -183,6 +183,12 @@ export class ProjectService {
async findOne(uuid: string): Promise<ProjectEntity> {
const project = await this.projectRepository.findOne({ where: { uuid } });
if (!project) {
throw new HttpException(
`Invalid project with uuid ${uuid}`,
HttpStatus.NOT_FOUND,
);
}
return project;
}