新增:优先级和所有仓库成员接口
This commit is contained in:
parent
c1d791741c
commit
934b42f1a1
|
@ -0,0 +1,9 @@
|
||||||
|
class Api::V1::Issues::IssuePrioritiesController < Api::V1::BaseController
|
||||||
|
|
||||||
|
before_action :require_public_and_member_above, only: [:index]
|
||||||
|
|
||||||
|
def index
|
||||||
|
@priorities = IssuePriority.order(position: :asc)
|
||||||
|
@priorities = kaminary_select_paginate(@priorities)
|
||||||
|
end
|
||||||
|
end
|
|
@ -0,0 +1,10 @@
|
||||||
|
class Api::V1::Projects::CollaboratorsController < Api::V1::BaseController
|
||||||
|
|
||||||
|
before_action :require_public_and_member_above, only: [:index]
|
||||||
|
|
||||||
|
def index
|
||||||
|
@collaborators = @project.all_collaborators.ransack(name_or_login_cont: params[:keyword]).result
|
||||||
|
@collaborators = kaminary_select_paginate(@collaborators)
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
|
@ -17,4 +17,4 @@ end
|
||||||
json.assigners issue.assigners.each do |assigner|
|
json.assigners issue.assigners.each do |assigner|
|
||||||
json.partial! "api/v1/users/simple_user", locals: {user: assigner}
|
json.partial! "api/v1/users/simple_user", locals: {user: assigner}
|
||||||
end
|
end
|
||||||
json.journals_count issue.comment_journals.size
|
json.comment_journals_count issue.comment_journals.size
|
|
@ -0,0 +1,4 @@
|
||||||
|
json.total_count @priorities.total_count
|
||||||
|
json.priorities @priorities.each do |priority|
|
||||||
|
json.(priority, :id, :name)
|
||||||
|
end
|
|
@ -0,0 +1,4 @@
|
||||||
|
json.total_count @collaborators.total_count
|
||||||
|
json.collaborators @collaborators.each do |collaborator|
|
||||||
|
json.partial! "api/v1/users/simple_user", locals: {user: collaborator}
|
||||||
|
end
|
|
@ -26,13 +26,14 @@ defaults format: :json do
|
||||||
end
|
end
|
||||||
|
|
||||||
resources :issues
|
resources :issues
|
||||||
scope module: :issues do
|
scope module: :issues do
|
||||||
resources :issue_tags, only: [:index]
|
resources :issue_tags, only: [:index]
|
||||||
resources :milestones, except: [:new, :edit]
|
resources :milestones, except: [:new, :edit]
|
||||||
resources :issue_statues, only: [:index], controller: '/api/v1/issues/statues'
|
resources :issue_statues, only: [:index], controller: '/api/v1/issues/statues'
|
||||||
resources :issue_authors, only: [:index], controller: '/api/v1/issues/authors'
|
resources :issue_authors, only: [:index], controller: '/api/v1/issues/authors'
|
||||||
resources :issue_assigners, only: [:index], controller: '/api/v1/issues/assigners'
|
resources :issue_assigners, only: [:index], controller: '/api/v1/issues/assigners'
|
||||||
end
|
resources :issue_priorities, only: [:index]
|
||||||
|
end
|
||||||
|
|
||||||
# projects文件夹下的
|
# projects文件夹下的
|
||||||
scope module: :projects do
|
scope module: :projects do
|
||||||
|
@ -45,7 +46,7 @@ defaults format: :json do
|
||||||
resources :journals, except: [:show, :edit]
|
resources :journals, except: [:show, :edit]
|
||||||
resources :reviews, only: [:index, :create]
|
resources :reviews, only: [:index, :create]
|
||||||
end
|
end
|
||||||
|
resources :collaborators, only: [:index]
|
||||||
resources :release_versions
|
resources :release_versions
|
||||||
resources :webhooks do
|
resources :webhooks do
|
||||||
member do
|
member do
|
||||||
|
|
Loading…
Reference in New Issue