Add support for using any of the current related tag types

Regardless of category or query. This meant that the category value
had to be passed in as either null or the value itself for both types
of functions. It also fixes an issue where the category wasn't settable
on the pattern matching type.
This commit is contained in:
BrokenEagle
2020-03-06 07:14:08 +00:00
parent 66d2fd7b98
commit af96d68c0b
2 changed files with 33 additions and 10 deletions

View File

@@ -4,9 +4,10 @@ class RelatedTagsController < ApplicationController
def show
query = params[:query] || search_params[:query]
category = params[:category] || search_params[:category]
type = params[:type] || search_params[:type]
limit = params[:limit]
@query = RelatedTagQuery.new(query: query, category: category, user: CurrentUser.user, limit: limit)
@query = RelatedTagQuery.new(query: query, category: category, type: type, user: CurrentUser.user, limit: limit)
respond_with(@query)
end
end