Skip to content
Snippets Groups Projects
Commit ad6340ef authored by Jérémie BRISON's avatar Jérémie BRISON
Browse files

fix(structureOwner) : fix error when invalid structure

parent 44632ddf
No related branches found
No related tags found
2 merge requests!38Recette,!37Dev
......@@ -352,6 +352,9 @@ export class StructuresService {
emailUser: string
): Promise<{ structure: Structure; owners: string[] }> {
const structure = await this.findOne(idStructure);
if (!structure) {
throw new HttpException('Invalid structure id', HttpStatus.BAD_REQUEST);
}
const owners = await this.userService.getStructureOwnersMails(idStructure, emailUser);
return { structure: structure, owners: owners };
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment