This commit is contained in:
@@ -66,14 +66,14 @@ class WikiPagesController < ApplicationController
|
||||
end
|
||||
|
||||
def search
|
||||
title = params[:title]&.strip
|
||||
|
||||
q = WikiPage.all
|
||||
q = q.where('title LIKE ?', "%#{ WikiPage.sanitize_sql_like(title) }%") if title.present?
|
||||
|
||||
if params[:title].present?
|
||||
title = params[:title].to_s.strip
|
||||
q = q.where('title LIKE ?', "%#{ WikiPage.sanitize_sql_like(title) }%")
|
||||
end
|
||||
|
||||
render json: q.limit(20)
|
||||
render json: q.limit(20).map { |page|
|
||||
page.sha = nil
|
||||
page }
|
||||
end
|
||||
|
||||
def changes
|
||||
|
||||
Reference in New Issue
Block a user