mirror of
https://github.com/SyncrowIOT/backend.git
synced 2025-11-27 20:04:55 +00:00
Refactor controllers to return UUID of added entities
This commit is contained in:
@ -35,11 +35,12 @@ export class UnitService {
|
||||
},
|
||||
});
|
||||
|
||||
await this.spaceRepository.save({
|
||||
const unit = await this.spaceRepository.save({
|
||||
spaceName: addUnitDto.unitName,
|
||||
parent: { uuid: addUnitDto.floorUuid },
|
||||
spaceType: { uuid: spaceType.uuid },
|
||||
});
|
||||
return unit;
|
||||
} catch (err) {
|
||||
throw new HttpException(err.message, HttpStatus.INTERNAL_SERVER_ERROR);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user