forked from e621ng/e621ng
add api endpoint for updating a tag's related tags
This commit is contained in:
parent
2285e65b25
commit
04926ae0c6
@ -9,4 +9,15 @@ class RelatedTagsController < ApplicationController
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def update
|
||||
render(text: "forbidden", status: 403) && return false unless params[:key] == Danbooru.config.shared_remote_key
|
||||
|
||||
@tag = Tag.find_by_name(params[:name])
|
||||
@tag.related_tags = params[:related_tags].scan(/\S+/).in_groups_of(2)
|
||||
@tag.related_tags_updated_at = Time.now
|
||||
@tag.save
|
||||
|
||||
render nothing: true
|
||||
end
|
||||
end
|
||||
|
@ -218,7 +218,7 @@ Rails.application.routes.draw do
|
||||
end
|
||||
end
|
||||
resources :artist_commentary_versions, :only => [:index]
|
||||
resource :related_tag, :only => [:show]
|
||||
resource :related_tag, :only => [:show, :update]
|
||||
get "reports/user_promotions" => "reports#user_promotions"
|
||||
get "reports/janitor_trials" => "reports#janitor_trials"
|
||||
get "reports/contributors" => "reports#contributors"
|
||||
|
Loading…
Reference in New Issue
Block a user