Commit 9faefc0e authored by Bruno Nocera Zanette's avatar Bruno Nocera Zanette
Browse files

fix bugs & rename Report Resource

parent 843b5bb2
......@@ -5,7 +5,7 @@ require "faraday"
require "active_support/all"
require_relative "dspace/version"
require_relative "dspace/resources/query_report_resource"
require_relative "dspace/resources/report_resource"
require_relative "dspace/resources/hierarchy_resource"
require_relative "dspace/resources/schema_registry_resource"
require_relative "dspace/resources/community_resource"
......@@ -27,6 +27,7 @@ require_relative "dspace/metadata_field"
require_relative "dspace/bitstream"
require_relative "dspace/policy"
require_relative "dspace/item_filter"
require_relative "dspace/report"
require_relative "dspace/client"
module Dspace
......
......@@ -30,7 +30,7 @@ module Dspace
authentication: ::Dspace::Resources::AuthenticationResource,
schema_registry: ::Dspace::Resources::SchemaRegistryResource,
hierarchy: ::Dspace::Resources::HierarchyResource,
query_report: ::Dspace::Resources::QueryReportResource
report: ::Dspace::Resources::ReportResource
}
end
......
module Dspace
module Resources
class QueryReportResource < ResourceKit::Resource
class ReportResource < ResourceKit::Resource
resources do
......@@ -49,8 +49,9 @@ module Dspace
# TODO: Test it!
action :filtered_collections,
'GET /rest/filtered-collections' do
query_keys :limit, :offset, :expand, :filters, :collection
handler(200) do |response|
Dspace::Builders::ModelBuilder.build_collections(JSON.parse(response.body)['collections'])
Dspace::Builders::ModelBuilder.build_collections(JSON.parse(response.body))
end
end
......@@ -59,7 +60,8 @@ module Dspace
# TODO: Fix query keys
# TODO: Test it!
action :filtered_collections_by_id,
'GET /filtered-collections/:collection_id' do
'GET /rest/filtered-collections/:collection_id' do
query_keys :limit, :offset, :expand, :filters, :collection
handler(200) do |response|
Dspace::Builders::ModelBuilder.build_items(JSON.parse(response.body)['items'])
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