Skip to content
Snippets Groups Projects
Commit f9e8f36c authored by Hugo SUBTIL's avatar Hugo SUBTIL
Browse files

Merge branch 'dev' into 'master'

Dev

See merge request web-et-numerique/pamn_plateforme-des-acteurs-de-la-mediation-numerique/pamn_server!39
parents d9595ab7 8fd705f5
No related branches found
No related tags found
2 merge requests!45Dev,!39Dev
......@@ -32,12 +32,19 @@ export class AdminController {
@ApiOperation({ description: 'Validate structure ownership' })
public async validatePendingStructure(@Body() pendingStructureDto: PendingStructureDto) {
const structure = await this.structuresService.findOne(pendingStructureDto.structureId);
return this.usersService.validatePendingStructure(
await this.usersService.validatePendingStructure(
pendingStructureDto.userEmail,
pendingStructureDto.structureId,
structure.structureName,
true
);
const pendingStructure = await this.usersService.getPendingStructures();
return await Promise.all(
pendingStructure.map(async (structure) => {
structure.structureName = (await this.structuresService.findOne(structure.structureId)).structureName;
return structure;
})
);
}
@UseGuards(JwtAuthGuard, RolesGuard)
......@@ -46,11 +53,18 @@ export class AdminController {
@ApiOperation({ description: 'Refuse structure ownership' })
public async refusePendingStructure(@Body() pendingStructureDto: PendingStructureDto) {
const structure = await this.structuresService.findOne(pendingStructureDto.structureId);
return this.usersService.validatePendingStructure(
await this.usersService.validatePendingStructure(
pendingStructureDto.userEmail,
pendingStructureDto.structureId,
structure.structureName,
false
);
const pendingStructure = await this.usersService.getPendingStructures();
return await Promise.all(
pendingStructure.map(async (structure) => {
structure.structureName = (await this.structuresService.findOne(structure.structureId)).structureName;
return structure;
})
);
}
}
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