新增: 查询删除分支与普通分支
This commit is contained in:
parent
a644a65493
commit
feec49d4bd
|
@ -2,7 +2,7 @@ class Api::V1::Projects::BranchesController < Api::V1::BaseController
|
||||||
before_action :require_public_and_member_above, only: [:index, :all]
|
before_action :require_public_and_member_above, only: [:index, :all]
|
||||||
|
|
||||||
def index
|
def index
|
||||||
@result_object = Api::V1::Projects::Branches::ListService.call(@project, {name: params[:keyword], page: page, limit: limit}, current_user&.gitea_token)
|
@result_object = Api::V1::Projects::Branches::ListService.call(@project, {name: params[:keyword], state: params[:state], page: page, limit: limit}, current_user&.gitea_token)
|
||||||
end
|
end
|
||||||
|
|
||||||
def all
|
def all
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
class Api::V1::Projects::Branches::ListService < ApplicationService
|
class Api::V1::Projects::Branches::ListService < ApplicationService
|
||||||
|
|
||||||
attr_accessor :project, :token, :owner, :repo, :name, :page, :limit
|
attr_accessor :project, :token, :owner, :repo, :name, :state, :page, :limit
|
||||||
attr_accessor :gitea_data, :gitea_repo_data
|
attr_accessor :gitea_data, :gitea_repo_data
|
||||||
|
|
||||||
def initialize(project, params, token=nil)
|
def initialize(project, params, token=nil)
|
||||||
|
@ -9,6 +9,7 @@ class Api::V1::Projects::Branches::ListService < ApplicationService
|
||||||
@repo = project&.identifier
|
@repo = project&.identifier
|
||||||
@token = token
|
@token = token
|
||||||
@name = params[:name]
|
@name = params[:name]
|
||||||
|
@state = params[:state]
|
||||||
@page = params[:page]
|
@page = params[:page]
|
||||||
@limit = params[:limit]
|
@limit = params[:limit]
|
||||||
end
|
end
|
||||||
|
@ -29,6 +30,7 @@ class Api::V1::Projects::Branches::ListService < ApplicationService
|
||||||
limit: limit
|
limit: limit
|
||||||
}
|
}
|
||||||
params.merge!({name: name}) if name.present?
|
params.merge!({name: name}) if name.present?
|
||||||
|
params.merge!({state: state}) if state.present?
|
||||||
|
|
||||||
params
|
params
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue