mirror of
https://github.com/SyncrowIOT/backend.git
synced 2026-10-24 00:17:54 +00:00
Refactor controllers to return UUID of added entities
This commit is contained in:
@@ -32,8 +32,8 @@ export class UnitController {
|
||||
@Post()
|
||||
async addUnit(@Body() addUnitDto: AddUnitDto) {
|
||||
try {
|
||||
await this.unitService.addUnit(addUnitDto);
|
||||
return { message: 'Unit added successfully' };
|
||||
const unit = await this.unitService.addUnit(addUnitDto);
|
||||
return { message: 'Unit added successfully', uuid: unit.uuid };
|
||||
} catch (error) {
|
||||
throw new HttpException(
|
||||
error.message || 'Internal server error',
|
||||
|
||||
Reference in New Issue
Block a user