summaryrefslogtreecommitdiffstats
path: root/app/views/files/index.api.rsb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2016-12-21 10:05:55 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2016-12-21 10:05:55 +0000
commite068f855dcc78e873d8214c123bd96fc0fcfa6db (patch)
treea27cb61c62b1adbdc8b5b6765535cd54fd0adef1 /app/views/files/index.api.rsb
parentf3627e2a3d1a9fa606fc71f66776d4b879b92323 (diff)
downloadredmine-e068f855dcc78e873d8214c123bd96fc0fcfa6db.tar.gz
redmine-e068f855dcc78e873d8214c123bd96fc0fcfa6db.zip
Files REST API (#19116).
Patch by Lucile Quirion and Jake Kemme. git-svn-id: http://svn.redmine.org/redmine/trunk@16109 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/views/files/index.api.rsb')
-rw-r--r--app/views/files/index.api.rsb14
1 files changed, 14 insertions, 0 deletions
diff --git a/app/views/files/index.api.rsb b/app/views/files/index.api.rsb
new file mode 100644
index 000000000..0a317e475
--- /dev/null
+++ b/app/views/files/index.api.rsb
@@ -0,0 +1,14 @@
+api.array :files do
+ @containers.each do |container|
+ container.attachments.each do |attachment|
+ api.file do
+ render_api_attachment_attributes(attachment, api)
+ if container.is_a?(Version)
+ api.version :id => container.id, :name => container.name
+ end
+ api.digest attachment.digest
+ api.downloads attachment.downloads
+ end
+ end
+ end
+end