Store user id from access token

This commit is contained in:
Justin Edmund 2020-09-26 10:51:14 -07:00
parent 5d5a09f552
commit b08d851341

View file

@ -6,7 +6,12 @@ class Api::V1::PartiesController < Api::V1::ApiController
end
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!
end