From 780e64a100d620574b0afa3cd8317dc4255344ad Mon Sep 17 00:00:00 2001 From: Go MAEDA Date: Mon, 9 Sep 2019 08:57:29 +0000 Subject: REST API for deleting news (#13468). Patch by Takenori TAKAKI. git-svn-id: http://svn.redmine.org/redmine/trunk@18442 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/controllers/news_controller.rb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'app') diff --git a/app/controllers/news_controller.rb b/app/controllers/news_controller.rb index 6c1e7f1bd..3ea0abea7 100644 --- a/app/controllers/news_controller.rb +++ b/app/controllers/news_controller.rb @@ -26,7 +26,7 @@ class NewsController < ApplicationController before_action :authorize, :except => [:index] before_action :find_optional_project, :only => :index accept_rss_auth :index - accept_api_auth :index, :show, :create + accept_api_auth :index, :show, :create, :destroy helper :watchers helper :attachments @@ -106,6 +106,9 @@ class NewsController < ApplicationController def destroy @news.destroy - redirect_to project_news_index_path(@project) + respond_to do |format| + format.html { redirect_to project_news_index_path(@project) } + format.api { render_api_ok } + end end end -- cgit v1.2.3