Commit 07c08220 authored by Justin Ho's avatar Justin Ho

Add basic backend to fetch labels

- Add route and controller action for labels
- Update serializer to include id which is needed by the
frontend
parent c7410921
...@@ -45,6 +45,10 @@ module Projects ...@@ -45,6 +45,10 @@ module Projects
end end
end end
def labels
render json: issue_json[:labels]
end
private private
def visitor_id def visitor_id
......
...@@ -32,6 +32,7 @@ module Integrations ...@@ -32,6 +32,7 @@ module Integrations
expose :labels do |jira_issue| expose :labels do |jira_issue|
jira_issue.labels.map do |name| jira_issue.labels.map do |name|
{ {
id: name,
title: name, title: name,
name: name, name: name,
color: '#0052CC', color: '#0052CC',
......
...@@ -116,7 +116,11 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do ...@@ -116,7 +116,11 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do
namespace :integrations do namespace :integrations do
namespace :jira do namespace :jira do
resources :issues, only: [:index, :show] resources :issues, only: [:index, :show] do
member do
get :labels
end
end
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