Add javascript callback for "assignee"
To make intrgration with external trackers easier, add JS API for assignee retrieval. It returns a script that calls a function that should act somehow depending on how it was defined.
This commit is contained in:
parent
e75a676895
commit
8629d67030
|
@ -40,7 +40,10 @@ class Platforms::MaintainersController < ApplicationController
|
|||
ret[:error] = 'Not found'
|
||||
end
|
||||
end
|
||||
render :json => ret
|
||||
respond_to do |format|
|
||||
format.json {render :json => ret}
|
||||
format.js {@ret = ret}
|
||||
end
|
||||
end
|
||||
|
||||
protected
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
doHandleAbfAssignee(<%= @ret.to_json.html_safe %>);
|
|
@ -51,6 +51,7 @@ Rosa::Application.routes.draw do
|
|||
# Maintainer Database API
|
||||
# (package name may contain dots, numbers, and all kinds of weird symbols, hence the :constraints relaxation)
|
||||
match 'api/json/maintdb/assignee/:platform_id/:package' => 'platforms/maintainers#assignee', :format => :json, :constraints => { :package => /.*/ }
|
||||
match 'api/js/maintdb/assignee/:platform_id/:package' => 'platforms/maintainers#assignee', :format => :js, :constraints => { :package => /.*/ }
|
||||
|
||||
scope :module => 'platforms' do
|
||||
resources :platforms do
|
||||
|
|
Loading…
Reference in New Issue