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

@ -2,7 +2,6 @@ import {
Body,
Controller,
Get,
HttpException,
HttpStatus,
Param,
Post,
@ -35,41 +34,27 @@ export class UserNotificationController {
async addUserSubscription(
@Body() userNotificationAddDto: UserNotificationAddDto,
) {
try {
const addDetails = await this.userNotificationService.addUserSubscription(
userNotificationAddDto,
);
return {
statusCode: HttpStatus.CREATED,
message: 'User Notification Added Successfully',
data: addDetails,
};
} catch (error) {
throw new HttpException(
error.message || 'Internal server error',
error.status || HttpStatus.INTERNAL_SERVER_ERROR,
);
}
const addDetails = await this.userNotificationService.addUserSubscription(
userNotificationAddDto,
);
return {
statusCode: HttpStatus.CREATED,
message: 'User Notification Added Successfully',
data: addDetails,
};
}
@ApiBearerAuth()
@UseGuards(JwtAuthGuard)
@Get(':userUuid')
async fetchUserSubscriptions(@Param('userUuid') userUuid: string) {
try {
const userDetails =
await this.userNotificationService.fetchUserSubscriptions(userUuid);
return {
statusCode: HttpStatus.OK,
message: 'User Notification fetched Successfully',
data: { ...userDetails },
};
} catch (error) {
throw new HttpException(
error.message || 'Internal server error',
error.status || HttpStatus.INTERNAL_SERVER_ERROR,
);
}
const userDetails =
await this.userNotificationService.fetchUserSubscriptions(userUuid);
return {
statusCode: HttpStatus.OK,
message: 'User Notification fetched Successfully',
data: { ...userDetails },
};
}
@ApiBearerAuth()
@UseGuards(JwtAuthGuard)
@ -77,19 +62,12 @@ export class UserNotificationController {
async updateUserSubscription(
@Body() userNotificationUpdateDto: UserNotificationUpdateDto,
) {
try {
await this.userNotificationService.updateUserSubscription(
userNotificationUpdateDto,
);
return {
statusCode: HttpStatus.OK,
message: 'User subscription updated Successfully',
};
} catch (error) {
throw new HttpException(
error.message || 'Internal server error',
error.status || HttpStatus.INTERNAL_SERVER_ERROR,
);
}
await this.userNotificationService.updateUserSubscription(
userNotificationUpdateDto,
);
return {
statusCode: HttpStatus.OK,
message: 'User subscription updated Successfully',
};
}
}