Skip to content

Commit

Permalink
add search event title
Browse files Browse the repository at this point in the history
  • Loading branch information
jiangplus committed Oct 10, 2024
1 parent 916724b commit b3b380f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions app/controllers/api/event_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,12 @@ def list
@events = @events.where("tags && ARRAY[:options]::varchar[]", options: params[:tags].split(","))
# @events = @events.where("tags @> ARRAY[?]::varchar[]", params[:tags].split(","))
end
if params[:search_title]
p 'params[:search_title]'
p params[:search_title]
@events = @events.where("title like ?", "%#{params[:search_title]}%")
# @events = @events.where("tags @> ARRAY[?]::varchar[]", params[:tags].split(","))
end
if params[:venue_id]
@events = @events.where(venue_id: params[:venue_id])
end
Expand Down

0 comments on commit b3b380f

Please sign in to comment.