|
|
@ -37,15 +37,27 @@ module Bcf::API::V2_1 |
|
|
|
scope: -> { @issue.viewpoints }) |
|
|
|
scope: -> { @issue.viewpoints }) |
|
|
|
.mount |
|
|
|
.mount |
|
|
|
|
|
|
|
|
|
|
|
route_param :uuid, regexp: /\A[a-f0-9\-]+\z/ do |
|
|
|
route_param :viewpoint_uuid, regexp: /\A[a-f0-9\-]+\z/ do |
|
|
|
after_validation do |
|
|
|
after_validation do |
|
|
|
@viewpoint = @issue.viewpoints.find_by_uuid!(params[:uuid]) |
|
|
|
@viewpoint = @issue.viewpoints.find_by_uuid!(params[:viewpoint_uuid]) |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
get &::Bcf::API::V2_1::Endpoints::Show |
|
|
|
get &::Bcf::API::V2_1::Endpoints::Show |
|
|
|
.new(model: Bcf::Viewpoint, |
|
|
|
.new(model: Bcf::Viewpoint, |
|
|
|
api_name: 'Viewpoints') |
|
|
|
api_name: 'Viewpoints') |
|
|
|
.mount |
|
|
|
.mount |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
namespace :snapshot do |
|
|
|
|
|
|
|
helpers ::API::Helpers::AttachmentRenderer |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
get do |
|
|
|
|
|
|
|
if snapshot = @viewpoint.snapshot |
|
|
|
|
|
|
|
respond_with_attachment snapshot |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
raise ActiveRecord::RecordNotFound |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|