Skip to content

Commit

Permalink
close #2170 store page path of guest waiting room (#2173)
Browse files Browse the repository at this point in the history
  • Loading branch information
LengTech11 authored Dec 19, 2024
1 parent 1d40c05 commit e9b0a31
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ class WaitingRoomSessionsController < ::Spree::Api::V2::ResourceController
def create
context = SpreeCmCommissioner::WaitingRoomSessionCreator.call(
remote_ip: request.remote_ip,
waiting_guest_firebase_doc_id: params[:waiting_guest_firebase_doc_id]
waiting_guest_firebase_doc_id: params[:waiting_guest_firebase_doc_id],
page_path: params[:page_path]
)

if context.success?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

module SpreeCmCommissioner
class WaitingRoomSessionCreator < BaseInteractor
delegate :remote_ip, :waiting_guest_firebase_doc_id, to: :context
delegate :remote_ip, :waiting_guest_firebase_doc_id, :page_path, to: :context

def call
return context.fail!(message: 'must_provide_waiting_guest_firebase_doc_id') if waiting_guest_firebase_doc_id.blank?
Expand Down Expand Up @@ -34,7 +34,8 @@ def assign_token_and_create_session_to_db
context.room_session.assign_attributes(
jwt_token: context.jwt_token,
expired_at: expired_at,
remote_ip: remote_ip
remote_ip: remote_ip,
page_path: page_path
)
context.room_session.save!
end
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class AddPagePathToCmWaitingRoomSessions < ActiveRecord::Migration[7.0]
def change
add_column :cm_waiting_room_sessions, :page_path, :string, if_not_exists: true
end
end

0 comments on commit e9b0a31

Please sign in to comment.