Merge branch 'dev_trustie' into dev_devops

This commit is contained in:
Jasder 2020-09-09 10:35:11 +08:00
commit d802b8aba4
1 changed files with 4 additions and 2 deletions

View File

@ -40,8 +40,10 @@ class RepositoriesController < ApplicationController
file_path_uri = URI.parse(URI.encode(params[:filepath].to_s.strip))
interactor = Repositories::EntriesInteractor.call(@project.owner, @project.identifier, file_path_uri, ref: @ref)
if interactor.success?
@sub_entries = interactor.result
@sub_entries = [] << @sub_entries unless @sub_entries.is_a? Array
result = interactor.result
return @sub_entries = [] if result[:status] == -1
@sub_entries = [] << result unless result.is_a? Array
@sub_entries = @sub_entries.sort_by{ |hash| hash['type'] }
else
render_error(interactor.error)