Store user id from access token
This commit is contained in:
parent
5d5a09f552
commit
b08d851341
1 changed files with 6 additions and 1 deletions
|
|
@ -6,7 +6,12 @@ class Api::V1::PartiesController < Api::V1::ApiController
|
||||||
end
|
end
|
||||||
|
|
||||||
def create
|
def create
|
||||||
@party = Party.new(shortcode: random_string, user_id: party_params[:user_id])
|
@party = Party.new(shortcode: random_string)
|
||||||
|
|
||||||
|
if current_user
|
||||||
|
@party.user = current_user
|
||||||
|
end
|
||||||
|
|
||||||
render :show, status: :created if @party.save!
|
render :show, status: :created if @party.save!
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue