Add waiting room to create programming groups (#1919)

Co-authored-by: Sebastian Serth <Sebastian.Serth@hpi.de>
This commit is contained in:
Kira Grammel
2023-09-21 15:07:10 +02:00
committed by GitHub
parent 1dfc306e76
commit 9f837412c7
15 changed files with 174 additions and 48 deletions

View File

@ -53,6 +53,9 @@ class ProgrammingGroupsController < ApplicationController
ActionCable.server.broadcast("pg_matching_channel_exercise_#{@exercise.id}", message)
end
# Check if the user was waiting for a programming group match and update the status
current_user.pair_programming_waiting_users&.find_by(exercise: @exercise)&.update(status: :created_pg, programming_group: @programming_group)
# Just set the programming group id in the session for the creator of the group, so that the user can be redirected.
session[:pg_id] = @programming_group.id