diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2012-10-28 20:17:38 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2012-10-28 20:17:38 +0000 |
commit | beb2610650595d4333fa88eb648146a6a26ad761 (patch) | |
tree | d66e443f66a843a342d04f956b1ad4fb8fb6c682 /app/controllers/wiki_controller.rb | |
parent | 625eebb720606efbd7e7094a34b8a9ba24ba6954 (diff) | |
download | redmine-beb2610650595d4333fa88eb648146a6a26ad761.tar.gz redmine-beb2610650595d4333fa88eb648146a6a26ad761.zip |
REST API for deleting wiki pages (#7082).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10743 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/controllers/wiki_controller.rb')
-rw-r--r-- | app/controllers/wiki_controller.rb | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/app/controllers/wiki_controller.rb b/app/controllers/wiki_controller.rb index 51e2ef367..9c6a4cf20 100644 --- a/app/controllers/wiki_controller.rb +++ b/app/controllers/wiki_controller.rb @@ -36,7 +36,7 @@ class WikiController < ApplicationController before_filter :find_wiki, :authorize before_filter :find_existing_or_new_page, :only => [:show, :edit, :update] before_filter :find_existing_page, :only => [:rename, :protect, :history, :diff, :annotate, :add_attachment, :destroy, :destroy_version] - accept_api_auth :index, :show, :update + accept_api_auth :index, :show, :update, :destroy helper :attachments include AttachmentsHelper @@ -263,11 +263,15 @@ class WikiController < ApplicationController end else @reassignable_to = @wiki.pages - @page.self_and_descendants - return + # display the destroy form if it's a user request + return unless api_request? end end @page.destroy - redirect_to :action => 'index', :project_id => @project + respond_to do |format| + format.html { redirect_to :action => 'index', :project_id => @project } + format.api { render_api_ok } + end end def destroy_version |