From 9ef7495db6e9c024fbe8c20b599d3e4d14f13b96 Mon Sep 17 00:00:00 2001 From: "sylor_huang@126.com" Date: Tue, 30 Jun 2020 11:47:26 +0800 Subject: [PATCH] change --- app/controllers/repositories_controller.rb | 2 +- app/services/gitea/repository/entries/list_service.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/repositories_controller.rb b/app/controllers/repositories_controller.rb index b4eb616f4..c777e9b6c 100644 --- a/app/controllers/repositories_controller.rb +++ b/app/controllers/repositories_controller.rb @@ -28,7 +28,7 @@ class RepositoriesController < ApplicationController @project.increment!(:visits) @project_owner = @project.owner @entries = Gitea::Repository::Entries::ListService.new(@project_owner, @project.identifier, ref: @ref).call - @entries = @entries["status"].to_i == 1 ? @entries.sort_by{ |hash| hash['type'] } : [] + @entries = @entries["status"].to_i != -1 ? @entries.sort_by{ |hash| hash['type'] } : [] @path = Gitea.gitea_config[:domain]+"/#{@project.owner.login}/#{@project.identifier}/raw/branch/#{@ref}/" end diff --git a/app/services/gitea/repository/entries/list_service.rb b/app/services/gitea/repository/entries/list_service.rb index 85b2c76e1..843e52ad0 100644 --- a/app/services/gitea/repository/entries/list_service.rb +++ b/app/services/gitea/repository/entries/list_service.rb @@ -27,7 +27,7 @@ class Gitea::Repository::Entries::ListService < Gitea::ClientService body = JSON.parse(response.body) case response.status when 200 - body.merge!({"status": 1}) + body else {'status': -1, 'message': "#{body['message']}"} end