changes
This commit is contained in:
@@ -38,6 +38,11 @@ export class SystemController {
|
||||
return this.systemService.findOne(id);
|
||||
}
|
||||
|
||||
@Get(':id/manager')
|
||||
getManagers(@Param('id') id: string) {
|
||||
return this.systemService.getManagers(id);
|
||||
}
|
||||
|
||||
@Patch(':id')
|
||||
update(@Param('id') id: string, @Body() updateSystemDto: UpdateSystemDto) {
|
||||
return this.systemService.update(id, updateSystemDto);
|
||||
|
||||
@@ -43,4 +43,13 @@ export class SystemService {
|
||||
const system = await this.systemRepo.findOne({ where: { id } });
|
||||
return this.systemRepo.softRemove(system);
|
||||
}
|
||||
|
||||
async getManagers(id: string) {
|
||||
const system = await this.systemRepo.findOne({
|
||||
where: { id: id },
|
||||
relations: ['managers']
|
||||
});
|
||||
|
||||
return system.managers;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user