Skip to content

Commit

Permalink
Fix: Meet Room Create
Browse files Browse the repository at this point in the history
  • Loading branch information
Hawardshin committed Nov 29, 2024
1 parent af855eb commit fcee225
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import capstone.relation.meeting.repository.MeetRoomRepository;
import capstone.relation.meeting.repository.RedisRepository;
import capstone.relation.user.UserService;
import capstone.relation.user.domain.User;
import capstone.relation.user.dto.RoomInfoDto;
import capstone.relation.user.dto.UserInfoDto;
import lombok.RequiredArgsConstructor;
Expand Down Expand Up @@ -59,9 +60,11 @@ public JoinResponseDto createAndJoinRoom(Long userId, CreateRoomDto createRoomDt
private Long createRoom(Long userId, String roomName) {
if (redisRepository.isUserInRoom(userId))
throw new MeetingException(MeetingErrorCode.MEETING_ALREADY_JOINED);
User user = userService.getUserEntity();
MeetRoom meetRoom = MeetRoom.builder()
.roomName(roomName)
.deleted(false)
.workSpace(user.getWorkSpace())
.build();
meetRoomRepository.save(meetRoom);
return meetRoom.getRoomId();
Expand Down

0 comments on commit fcee225

Please sign in to comment.