Fix set_from_slug
This commit is contained in:
parent
433bd19f6d
commit
b0b446aba3
1 changed files with 5 additions and 1 deletions
|
|
@ -124,7 +124,11 @@ module Api
|
|||
|
||||
def set_from_slug
|
||||
@party = Party.where('shortcode = ?', params[:id]).first
|
||||
@party.favorited = current_user && @party ? @party.is_favorited(current_user) : false
|
||||
if @party
|
||||
@party.favorited = current_user && @party ? @party.is_favorited(current_user) : false
|
||||
else
|
||||
render_not_found_response('party')
|
||||
end
|
||||
end
|
||||
|
||||
def set
|
||||
|
|
|
|||
Loading…
Reference in a new issue