Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
suk-6 committed Jul 19, 2024
1 parent 9fd9fca commit 246bb25
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
1 change: 1 addition & 0 deletions src/modules/user/user.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ export class UserController {
@CurrentUser() user: User,
@Body() data: UpdateUserFCMTokenDTO,
): Promise<ResponseDTO<null>> {
console.log('🚀 ~ UserController ~ data:', data);
await this.userService.updateUserFCMTokenById(user.id, data.FCMToken);
return { status: 'success', data: null };
}
Expand Down
11 changes: 4 additions & 7 deletions src/modules/user/user.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,13 @@ export class UserService {
}

async updateUserFCMTokenById(id: string, FCMToken: string) {
console.log('🚀 ~ UserService ~ updateUserFCMTokenById ~ FCMToken:', FCMToken);
const user = await this.prisma.user.findUnique({ where: { id } });
if (!user) throw new HttpException('User not found', HttpStatus.NOT_FOUND);

await this.prisma.user
.update({
where: { id },
data: { FCMToken },
})
.then((res) => console.log(res));
await this.prisma.user.update({
where: { id },
data: { FCMToken },
});
}

/**
Expand Down

0 comments on commit 246bb25

Please sign in to comment.