mirror of
https://github.com/SyncrowIOT/backend.git
synced 2026-03-10 20:31:43 +00:00
added project validation
This commit is contained in:
@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user