mirror of
https://github.com/SyncrowIOT/backend.git
synced 2025-11-26 12:34:54 +00:00
Refactor controllers to return UUID of added entities
This commit is contained in:
@ -32,8 +32,8 @@ export class BuildingController {
|
||||
@Post()
|
||||
async addBuilding(@Body() addBuildingDto: AddBuildingDto) {
|
||||
try {
|
||||
await this.buildingService.addBuilding(addBuildingDto);
|
||||
return { message: 'Building added successfully' };
|
||||
const building = await this.buildingService.addBuilding(addBuildingDto);
|
||||
return { message: 'Building added successfully', uuid: building.uuid };
|
||||
} catch (error) {
|
||||
throw new HttpException(
|
||||
error.message || 'Internal server error',
|
||||
|
||||
Reference in New Issue
Block a user