Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
 into renewal
  • Loading branch information
overthestream committed Sep 28, 2024
2 parents 651c248 + 0ac271a commit d7ed516
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 2 additions & 0 deletions src/domain/chat/chat.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@ import { RoomChatDto, RoomInfoDto } from 'src/domain/chat/dtos';
import { UserProfileDto } from 'src/domain/dtos/user.dto';
import { Docs } from 'src/decorators/swagger/chat.decorator';
import { User } from 'src/decorators/accessUser.decorator';
import { ApiTags } from '@nestjs/swagger';

@Controller('chat')
@ApiTags('chat')
export class ChatController {
constructor(private readonly chatService: ChatService) {}

Expand Down
9 changes: 6 additions & 3 deletions src/domain/chat/chat.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ export class ChatService {
}

async finishFreeChatRoom(userId: number): Promise<void> {
await this.roomModel.findOneAndUpdate(
await this.roomModel.updateOne(
{
users: {
$elemMatch: { userId: userId },
Expand Down Expand Up @@ -321,9 +321,12 @@ export class ChatService {
async updateBlurStep(roomId: string, otherUser: number): Promise<number> {
const room = await this.roomModel.findOne({ id: roomId });
const index = room.users.findIndex((user) => user.userId == otherUser);
room.users[index].blur = await this.checkBlurChange(room, index);
const blurChanged = await this.checkBlurChange(room, index);

await room.save();
if (blurChanged != null) {
room.users[index].blur = blurChanged;
await room.save();
}

return room.users[index].blur;
}
Expand Down

0 comments on commit d7ed516

Please sign in to comment.