FIX get repository api bug

This commit is contained in:
Jasder 2020-06-01 15:33:40 +08:00
parent 03448c76f3
commit ffa4a948ee
1 changed files with 2 additions and 1 deletions

View File

@ -10,7 +10,8 @@ class RepositoriesController < ApplicationController
def show def show
@branches_count = Gitea::Repository::BranchesService.new(@project.owner, @project.identifier).call&.size @branches_count = Gitea::Repository::BranchesService.new(@project.owner, @project.identifier).call&.size
@commits_count = Gitea::Repository::Commits::ListService.new(@project.owner, @project.identifier).call[:total_count] @commits_count = Gitea::Repository::Commits::ListService.new(@project.owner.login, @project.identifier,
sha: params[:sha], page: params[:page], limit: params[:limit], token: current_user&.gitea_token).call[:total_count]
@tags_count = Gitea::Repository::Tags::ListService.new(current_user&.gitea_token, @project.owner.login, @project.identifier).call&.size @tags_count = Gitea::Repository::Tags::ListService.new(current_user&.gitea_token, @project.owner.login, @project.identifier).call&.size
@result = Gitea::Repository::GetService.new(@project.owner, @project.identifier).call @result = Gitea::Repository::GetService.new(@project.owner, @project.identifier).call
@project_fork_id = @project.try(:forked_from_project_id) @project_fork_id = @project.try(:forked_from_project_id)