新增:优先级和所有仓库成员接口

This commit is contained in:
yystopf 2023-02-09 16:20:16 +08:00
parent c1d791741c
commit 934b42f1a1
6 changed files with 37 additions and 9 deletions

View File

@ -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

View File

@ -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

View File

@ -17,4 +17,4 @@ end
json.assigners issue.assigners.each do |assigner|
json.partial! "api/v1/users/simple_user", locals: {user: assigner}
end
json.journals_count issue.comment_journals.size
json.comment_journals_count issue.comment_journals.size

View File

@ -0,0 +1,4 @@
json.total_count @priorities.total_count
json.priorities @priorities.each do |priority|
json.(priority, :id, :name)
end

View File

@ -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

View File

@ -26,13 +26,14 @@ defaults format: :json do
end
resources :issues
scope module: :issues do
resources :issue_tags, only: [:index]
resources :milestones, except: [:new, :edit]
resources :issue_statues, only: [:index], controller: '/api/v1/issues/statues'
resources :issue_authors, only: [:index], controller: '/api/v1/issues/authors'
resources :issue_assigners, only: [:index], controller: '/api/v1/issues/assigners'
end
scope module: :issues do
resources :issue_tags, only: [:index]
resources :milestones, except: [:new, :edit]
resources :issue_statues, only: [:index], controller: '/api/v1/issues/statues'
resources :issue_authors, only: [:index], controller: '/api/v1/issues/authors'
resources :issue_assigners, only: [:index], controller: '/api/v1/issues/assigners'
resources :issue_priorities, only: [:index]
end
# projects文件夹下的
scope module: :projects do
@ -45,7 +46,7 @@ defaults format: :json do
resources :journals, except: [:show, :edit]
resources :reviews, only: [:index, :create]
end
resources :collaborators, only: [:index]
resources :release_versions
resources :webhooks do
member do