mirror of
https://github.com/neocities/neocities.git
synced 2025-04-25 01:32:36 +02:00
Fix error with empty tag remove
This commit is contained in:
parent
f92a0d7b43
commit
7c4b332acf
1 changed files with 6 additions and 4 deletions
10
app/tags.rb
10
app/tags.rb
|
@ -14,13 +14,15 @@ end
|
|||
post '/tags/remove' do
|
||||
require_login
|
||||
|
||||
DB.transaction {
|
||||
params[:tags].each {|tag| current_site.remove_tag Tag[name: tag]}
|
||||
}
|
||||
if params[:tags].is_a?(Array)
|
||||
DB.transaction {
|
||||
params[:tags].each {|tag| current_site.remove_tag Tag[name: tag]}
|
||||
}
|
||||
end
|
||||
|
||||
redirect request.referer
|
||||
end
|
||||
|
||||
get '/tags/autocomplete/:name.json' do |name|
|
||||
Tag.autocomplete(name).collect {|t| t[:name]}.to_json
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Reference in a new issue