aboutsummaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/controllers/api/v1/imports_controller.rb4
-rw-r--r--app/views/api/v1/imports/index.rabl3
-rw-r--r--app/views/api/v1/imports/show.rabl6
3 files changed, 13 insertions, 0 deletions
diff --git a/app/controllers/api/v1/imports_controller.rb b/app/controllers/api/v1/imports_controller.rb
new file mode 100644
index 000000000..ac2ec4516
--- /dev/null
+++ b/app/controllers/api/v1/imports_controller.rb
@@ -0,0 +1,4 @@
+class Api::V1::ImportsController < Api::V1::IbooController
+ defaults :resource_class => Api::V1::ApiKey
+ belongs_to :workbench
+end
diff --git a/app/views/api/v1/imports/index.rabl b/app/views/api/v1/imports/index.rabl
new file mode 100644
index 000000000..e8cfd101e
--- /dev/null
+++ b/app/views/api/v1/imports/index.rabl
@@ -0,0 +1,3 @@
+collection @imports
+
+extends "api/v1/imports/show"
diff --git a/app/views/api/v1/imports/show.rabl b/app/views/api/v1/imports/show.rabl
new file mode 100644
index 000000000..180894cb8
--- /dev/null
+++ b/app/views/api/v1/imports/show.rabl
@@ -0,0 +1,6 @@
+object @import
+
+attributes :id, :name, :status
+node :referential_ids do |i|
+ i.workbench.referentials.map(&:id)
+end