Merge remote-tracking branch 'upstream/pull/5622'

This commit is contained in:
Tom Hughes 2025-02-12 17:59:25 +00:00
commit 22f590c9ef
4 changed files with 22 additions and 4 deletions

View file

@ -266,7 +266,9 @@ module Api
end
# Add any text filter
@notes = @notes.joins(:comments).where("to_tsvector('english', note_comments.body) @@ plainto_tsquery('english', ?)", params[:q]) if params[:q]
if params[:q]
@notes = @notes.joins(:comments).where("to_tsvector('english', note_comments.body) @@ plainto_tsquery('english', ?) OR to_tsvector('english', notes.description) @@ plainto_tsquery('english', ?)", params[:q], params[:q])
end
# Add any date filter
if params[:from]