Refactor controllers to return UUID of added entities

This commit is contained in:
faris Aljohari
2024-05-01 10:34:07 +03:00
parent 229909f959
commit d146cce1bb
10 changed files with 21 additions and 15 deletions

View File

@ -34,8 +34,9 @@ export class CommunityController {
@Post()
async addCommunity(@Body() addCommunityDto: AddCommunityDto) {
try {
await this.communityService.addCommunity(addCommunityDto);
return { message: 'Community added successfully' };
const community =
await this.communityService.addCommunity(addCommunityDto);
return { message: 'Community added successfully', uuid: community.uuid };
} catch (error) {
throw new HttpException(
error.message || 'Internal server error',