mirror of
https://github.com/fluent/fluentd-ui.git
synced 2026-05-05 19:06:12 +02:00
Use Fluentd::Setting::Config#delete_element
Signed-off-by: Kenji Okimoto <okimoto@clear-code.com>
This commit is contained in:
parent
9b1b48e47b
commit
a13c488d0e
@ -25,13 +25,19 @@ class Api::SettingsController < ApplicationController
|
||||
end
|
||||
|
||||
def destroy
|
||||
unless @config.elements.index(@section)
|
||||
render_404
|
||||
return
|
||||
if params[:label] == "ROOT"
|
||||
name = params[:pluginType]
|
||||
arg = params[:arg]
|
||||
else
|
||||
name = "label"
|
||||
arg = params[:label]
|
||||
end
|
||||
if @config.delete_element(name, arg, @target_element)
|
||||
@config.write_to_file
|
||||
head :no_content # 204
|
||||
else
|
||||
render_404
|
||||
end
|
||||
@config.elements.delete @section
|
||||
@config.write_to_file
|
||||
head :no_content # 204
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user