Merge branch 'develop' into standalone_develop
This commit is contained in:
commit
721116467b
|
@ -11,6 +11,6 @@ class Api::V1::Projects::CommitsController < Api::V1::BaseController
|
||||||
end
|
end
|
||||||
|
|
||||||
def recent
|
def recent
|
||||||
@result_object = Api::V1::Projects::Commits::RecentService.call(@project, {page: page, limit: limit}, current_user&.gitea_token)
|
@result_object = Api::V1::Projects::Commits::RecentService.call(@project, {keyword: params[:keyword], page: page, limit: limit}, current_user&.gitea_token)
|
||||||
end
|
end
|
||||||
end
|
end
|
|
@ -1,12 +1,13 @@
|
||||||
class Api::V1::Projects::Commits::RecentService < ApplicationService
|
class Api::V1::Projects::Commits::RecentService < ApplicationService
|
||||||
|
|
||||||
attr_reader :project, :page, :limit, :owner, :repo, :token
|
attr_reader :project, :page, :limit, :keyword, :owner, :repo, :token
|
||||||
attr_accessor :gitea_data
|
attr_accessor :gitea_data
|
||||||
|
|
||||||
def initialize(project, params, token=nil)
|
def initialize(project, params, token=nil)
|
||||||
@project = project
|
@project = project
|
||||||
@page = params[:page] || 1
|
@page = params[:page] || 1
|
||||||
@limit = params[:limit] || 15
|
@limit = params[:limit] || 15
|
||||||
|
@keyword = params[:keyword]
|
||||||
@owner = project&.owner&.login
|
@owner = project&.owner&.login
|
||||||
@repo = project&.identifier
|
@repo = project&.identifier
|
||||||
@token = token
|
@token = token
|
||||||
|
@ -25,6 +26,7 @@ class Api::V1::Projects::Commits::RecentService < ApplicationService
|
||||||
page: page,
|
page: page,
|
||||||
limit: limit
|
limit: limit
|
||||||
}
|
}
|
||||||
|
param.merge!(keyword: keyword) if keyword.present?
|
||||||
|
|
||||||
param
|
param
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue