Patch #14828

Patch to add support for deleting attachments via API

Added by Michael Medin almost 5 years ago. Updated about 2 years ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:Jean-Philippe Lang% Done:

0%

Category:REST API
Target version:3.3.0

Description

A patch to add support for deleting attachments via the REST API:

 app/controllers/attachments_controller.rb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/app/controllers/attachments_controller.rb b/app/controllers/attachments_controller.rb
index 5a816a7..31fcb8a 100644
--- a/app/controllers/attachments_controller.rb
+++ b/app/controllers/attachments_controller.rb
@@ -21,7 +21,7 @@ class AttachmentsController < ApplicationController
   before_filter :delete_authorize, :only => :destroy
   before_filter :authorize_global, :only => :upload

-  accept_api_auth :show, :download, :upload
+  accept_api_auth :show, :download, :upload, :destroy

   def show
     respond_to do |format|

Usage:

DELETE /attachments/[id].[format]

// Michael Medin

patch.diff Magnifier - patch by Oliver Luethi (1.12 KB) Go MAEDA, 2016-03-23 09:26

add_support_for_deleting_attachments_via_api_trunk_r15327.patch Magnifier (1.88 KB) Takenori TAKAKI, 2016-04-12 02:51


Related issues

Related to Redmine - Feature #17879: support deleting attachments Closed
Duplicated by Redmine - Patch #22308: delete attachments over REST API Closed

Associated revisions

Revision 15332
Added by Jean-Philippe Lang about 2 years ago

Support for deleting attachments via API (#14828).

Patch by Takenori TAKAKI.

History

#1 Updated by Emmanuel Mathot over 4 years ago

Its working fine!
Thank you!

#2 Updated by Go MAEDA about 2 years ago

#3 Updated by Go MAEDA about 2 years ago

  • Duplicated by Patch #22308: delete attachments over REST API added

#4 Updated by Go MAEDA about 2 years ago

  • Target version set to Candidate for next major release

#5 Updated by Go MAEDA about 2 years ago

Here is an updated patch by Oliver Luethi (#22308) : patch.diff

#6 Updated by Takenori TAKAKI about 2 years ago

I have updated the patch as below:
  • Compatible with latest trunk (r15327)
  • Added test-codes

I would be very happy if I could see the feature in Redmine 3.3.0.

#7 Updated by Jean-Philippe Lang about 2 years ago

  • Target version changed from Candidate for next major release to 3.3.0

#8 Updated by Jean-Philippe Lang about 2 years ago

  • Status changed from New to Closed
  • Assignee set to Jean-Philippe Lang

Committed, thanks.

Also available in: Atom PDF