プロジェクト

全般

プロフィール

Vote #74345

完了

Patch to add support for deleting attachments via API

Admin Redmine さんが3年以上前に追加. 3年以上前に更新.

ステータス:
Closed
優先度:
通常
担当者:
-
カテゴリ:
REST API_32
対象バージョン:
開始日:
2022/05/09
期日:
進捗率:

0%

予定工数:
category_id:
32
version_id:
110
issue_org_id:
14828
author_id:
84973
assigned_to_id:
1
comments:
8
status_id:
5
tracker_id:
3
plus1:
0
affected_version:
closed_on:
affected_version_id:
ステータス-->[Closed]

説明

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


journals

Its working fine!
Thank you!
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------

--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
Here is an updated patch by "Oliver Luethi":http://www.redmine.org/users/148121 (#22308) : attachment:patch.diff
--------------------------------------------------------------------------------
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.
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
Committed, thanks.
--------------------------------------------------------------------------------


related_issues

relates,Closed,17879,support deleting attachments
duplicates,Closed,22308,delete attachments over REST API

Admin Redmine さんが3年以上前に更新

  • カテゴリREST API_32 にセット
  • 対象バージョン3.3.0_110 にセット

他の形式にエクスポート: Atom PDF

いいね!0
いいね!0