related tags: refactor /related_tags.js to avoid updating unchanged columns.

Refactor the /related_tags.js call so that when the "Related tags"
button is clicked, it only replaces the columns that actually changed,
not the entire related tags section.

This avoids rebuilding the Recent / Frequent / Translated Tags / Artist
columns every time the "Related tags" button is clicked.
This commit is contained in:
evazion
2018-10-15 13:10:08 -05:00
parent d536f75505
commit 6223f89a99
13 changed files with 81 additions and 75 deletions

View File

@@ -3,7 +3,7 @@ class RelatedTagsController < ApplicationController
before_action :require_reportbooru_key, only: [:update]
def show
@query = RelatedTagQuery.new(params[:query], category: params[:category], translated_tags: params[:translated_tags], artists: params[:artists], user: CurrentUser.user)
@query = RelatedTagQuery.new(query: params[:query], category: params[:category], user: CurrentUser.user)
respond_with(@query) do |format|
format.json do
render :json => @query.to_json