resolve conflicts

This commit is contained in:
unknown
2024-10-08 10:59:31 +03:00
53 changed files with 1009 additions and 1535 deletions

View File

@ -3,7 +3,6 @@ import {
Controller,
Delete,
Get,
HttpException,
HttpStatus,
Param,
Put,
@ -34,14 +33,7 @@ export class UserController {
@UseGuards(JwtAuthGuard)
@Get(':userUuid')
async getUserDetailsByUserUuid(@Param('userUuid') userUuid: string) {
try {
return await this.userService.getUserDetailsByUserUuid(userUuid);
} catch (error) {
throw new HttpException(
error.message || 'Internal server error',
error.status || HttpStatus.INTERNAL_SERVER_ERROR,
);
}
return await this.userService.getUserDetailsByUserUuid(userUuid);
}
@ApiBearerAuth()
@UseGuards(JwtAuthGuard, CheckProfilePictureGuard)
@ -50,23 +42,16 @@ export class UserController {
@Param('userUuid') userUuid: string,
@Body() updateProfilePictureDataDto: UpdateProfilePictureDataDto,
) {
try {
const userData = await this.userService.updateProfilePictureByUserUuid(
userUuid,
updateProfilePictureDataDto,
);
return {
statusCode: HttpStatus.CREATED,
success: true,
message: 'profile picture updated successfully',
data: userData,
};
} catch (error) {
throw new HttpException(
error.message || 'Internal server error',
error.status || HttpStatus.INTERNAL_SERVER_ERROR,
);
}
const userData = await this.userService.updateProfilePictureByUserUuid(
userUuid,
updateProfilePictureDataDto,
);
return {
statusCode: HttpStatus.CREATED,
success: true,
message: 'profile picture updated successfully',
data: userData,
};
}
@ApiBearerAuth()
@UseGuards(JwtAuthGuard)
@ -75,23 +60,16 @@ export class UserController {
@Param('userUuid') userUuid: string,
@Body() updateRegionDataDto: UpdateRegionDataDto,
) {
try {
const userData = await this.userService.updateRegionByUserUuid(
userUuid,
updateRegionDataDto,
);
return {
statusCode: HttpStatus.CREATED,
success: true,
message: 'region updated successfully',
data: userData,
};
} catch (error) {
throw new HttpException(
error.message || 'Internal server error',
error.status || HttpStatus.INTERNAL_SERVER_ERROR,
);
}
const userData = await this.userService.updateRegionByUserUuid(
userUuid,
updateRegionDataDto,
);
return {
statusCode: HttpStatus.CREATED,
success: true,
message: 'region updated successfully',
data: userData,
};
}
@ApiBearerAuth()
@UseGuards(JwtAuthGuard)
@ -100,23 +78,16 @@ export class UserController {
@Param('userUuid') userUuid: string,
@Body() updateTimezoneDataDto: UpdateTimezoneDataDto,
) {
try {
const userData = await this.userService.updateTimezoneByUserUuid(
userUuid,
updateTimezoneDataDto,
);
return {
statusCode: HttpStatus.CREATED,
success: true,
message: 'timezone updated successfully',
data: userData,
};
} catch (error) {
throw new HttpException(
error.message || 'Internal server error',
error.status || HttpStatus.INTERNAL_SERVER_ERROR,
);
}
const userData = await this.userService.updateTimezoneByUserUuid(
userUuid,
updateTimezoneDataDto,
);
return {
statusCode: HttpStatus.CREATED,
success: true,
message: 'timezone updated successfully',
data: userData,
};
}
@ApiBearerAuth()
@UseGuards(JwtAuthGuard)
@ -125,23 +96,16 @@ export class UserController {
@Param('userUuid') userUuid: string,
@Body() updateNameDto: UpdateNameDto,
) {
try {
const userData = await this.userService.updateNameByUserUuid(
userUuid,
updateNameDto,
);
return {
statusCode: HttpStatus.CREATED,
success: true,
message: 'name updated successfully',
data: userData,
};
} catch (error) {
throw new HttpException(
error.message || 'Internal server error',
error.status || HttpStatus.INTERNAL_SERVER_ERROR,
);
}
const userData = await this.userService.updateNameByUserUuid(
userUuid,
updateNameDto,
);
return {
statusCode: HttpStatus.CREATED,
success: true,
message: 'name updated successfully',
data: userData,
};
}
@ApiBearerAuth()
@UseGuards(SuperAdminRoleGuard)