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
end
end
def labels
render json: issue_json[:labels]
end
private
def visitor_id
......
......@@ -32,6 +32,7 @@ module Integrations
expose :labels do |jira_issue|
jira_issue.labels.map do |name|
{
id: name,
title: name,
name: name,
color: '#0052CC',
......
......@@ -116,7 +116,11 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do
namespace :integrations do
namespace :jira do
resources :issues, only: [:index, :show]
resources :issues, only: [:index, :show] do
member do
get :labels
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