This commit is contained in:
2025-06-29 22:27:28 +09:00
parent 281c85f2f6
commit 068d0aed14
4 changed files with 94 additions and 32 deletions
@@ -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