mirror of
https://github.com/SyncrowIOT/backend.git
synced 2026-10-24 06:27:55 +00:00
Refactor controllers to return UUID of added entities
This commit is contained in:
@@ -32,8 +32,8 @@ export class FloorController {
|
||||
@Post()
|
||||
async addFloor(@Body() addFloorDto: AddFloorDto) {
|
||||
try {
|
||||
await this.floorService.addFloor(addFloorDto);
|
||||
return { message: 'Floor added successfully' };
|
||||
const floor = await this.floorService.addFloor(addFloorDto);
|
||||
return { message: 'Floor added successfully', uuid: floor.uuid };
|
||||
} catch (error) {
|
||||
throw new HttpException(
|
||||
error.message || 'Internal server error',
|
||||
|
||||
Reference in New Issue
Block a user