adding items actions for collection resource

parent f7c6c17e
......@@ -19,6 +19,18 @@ module Dspace
end
end
action :items, 'GET /rest/collections/:id/items' do
query_keys :expand, :limit, :offset
handler(200) do |response|
Dspace::Builders::ModelBuilder.build_(JSON.parse(response.body))
end
end
action :create_item, 'POST /rest/collections/:id/items' do
body { |object| JSON.generate(object.to_h) }
handler(200, 201) { |response| true }
end
action :update, 'PUT /rest/collections/:id' do
body { |object| JSON.generate(object.to_h) }
handler(200, 201) { |response| true }
......@@ -28,6 +40,10 @@ module Dspace
handler(200, 201, 204) { |response| true }
end
action :delete_item, 'DELETE /rest/collections/:id/items/:item_id' do
handler(200, 201, 204) { |response| true }
end
end
end
end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment