Browse Source

FIX [api] get pull files and commits bug

pull/278/head
Jasder 5 years ago
parent
commit
37be604e82
2 changed files with 3 additions and 3 deletions
  1. +2
    -2
      app/controllers/pull_requests_controller.rb
  2. +1
    -1
      app/services/gitea/pull_request/commits_service.rb

+ 2
- 2
app/controllers/pull_requests_controller.rb View File

@@ -189,12 +189,12 @@ class PullRequestsController < ApplicationController


def files
@files_result = Gitea::PullRequest::FilesService.call(@owner.login, @project.identifier, @pull_request.gpid)
@files_result = Gitea::PullRequest::FilesService.call(@owner.login, @project.identifier, @pull_request.gpid, current_user&.gitea_token)
# render json: @files_result
end

def commits
@commits_result = Gitea::PullRequest::CommitsService.call(@owner.login, @project.identifier, @pull_request.gpid)
@commits_result = Gitea::PullRequest::CommitsService.call(@owner.login, @project.identifier, @pull_request.gpid, current_user&.gitea_token)
# render json: @commits_result
end



+ 1
- 1
app/services/gitea/pull_request/commits_service.rb View File

@@ -22,7 +22,7 @@ class Gitea::PullRequest::CommitsService < Gitea::ClientService

private
def params
Hash.new.merge(token: owner)
Hash.new.merge(token: token)
end

def url


Loading…
Cancel
Save