diff --git a/src/structures/structures.controller.ts b/src/structures/structures.controller.ts index 96ed9e332a5dbed7b9190cbc5dc88802b678c94d..67e12c9a15469d46919601363dbfbe8882344fce 100644 --- a/src/structures/structures.controller.ts +++ b/src/structures/structures.controller.ts @@ -120,7 +120,12 @@ export class StructuresController { @Get(':id') public async find(@Param('id') id: string) { - return this.structureService.findOne(id); + const result = await this.structureService.findOne(id); + if (!result || result.deletedAt) { + throw new HttpException('Structure does not exist', HttpStatus.NOT_FOUND); + } else { + return result; + } } @Post(':id/withOwners')