mirror of
https://github.com/SyncrowIOT/backend.git
synced 2025-07-15 02:15:21 +00:00
resolve conflicts
This commit is contained in:
@ -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',
|
||||
};
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user