Skip to content

Commit

Permalink
Allow api/v2/searches/:q API to use dot for params[:q]
Browse files Browse the repository at this point in the history
  • Loading branch information
wildjcrt committed Oct 7, 2024
1 parent 50210db commit ca367cf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/api/v2/searches_api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ class SearchesAPI < Base
params do
requires :q, type: String, desc: "搜尋族語/漢語關鍵字,族語 1~3 字使用精確搜尋,超過 3 字用 sql LIKE 搜尋。漢語一律用 sql LIKE 搜尋 Description#content。"
end
get ":q" do
get ":q", requirements: { q: /.*/ } do
result = []

if params[:q].match?(/\A[a-zA-Z'’ʼ^ ,….:;\-\(\)]+\z/) # 族語搜尋
Expand Down

0 comments on commit ca367cf

Please sign in to comment.