Created
December 8, 2014 22:31
-
-
Save cfitz/fd1d685745498b68f0bc to your computer and use it in GitHub Desktop.
reports.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# plugins/local/backend/controllers/reports.rb | |
class ArchivesSpaceService < Sinatra::Base | |
ReportManager.registered_reports.each do |uri_suffix, opts| | |
Endpoint.get("/repositories/:repo_id/reports/#{uri_suffix}") | |
.description(opts[:description]) | |
.params(*(opts[:params] << ReportHelper.report_formats << ["repo_id", :repo_id])) | |
.permissions([]) | |
.returns([200, "report"]) \ | |
do | |
report_response(opts[:model].new(params), params[:format]) | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment