|
|
|
@@ -1,6 +1,6 @@ |
|
|
|
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 |
|
|
|
|
|
|
|
def initialize(project, params, token=nil) |
|
|
|
@@ -9,6 +9,7 @@ class Api::V1::Projects::Branches::ListService < ApplicationService |
|
|
|
@repo = project&.identifier |
|
|
|
@token = token |
|
|
|
@name = params[:name] |
|
|
|
@state = params[:state] |
|
|
|
@page = params[:page] |
|
|
|
@limit = params[:limit] |
|
|
|
end |
|
|
|
@@ -29,7 +30,8 @@ class Api::V1::Projects::Branches::ListService < ApplicationService |
|
|
|
limit: limit |
|
|
|
} |
|
|
|
params.merge!({name: name}) if name.present? |
|
|
|
|
|
|
|
params.merge!({state: state}) if state.present? |
|
|
|
|
|
|
|
params |
|
|
|
end |
|
|
|
|
|
|
|
|