FIX get sub entries bug

This commit is contained in:
Jasder 2020-09-11 23:04:16 +08:00
parent bb98dad64c
commit b785105730
1 changed files with 1 additions and 1 deletions

View File

@ -41,7 +41,7 @@ class RepositoriesController < ApplicationController
interactor = Repositories::EntriesInteractor.call(@project.owner, @project.identifier, file_path_uri, ref: @ref)
if interactor.success?
result = interactor.result
return @sub_entries = [] if result[:status] == -1
return @sub_entries = [] if result.is_a?(Hash) && result[:status] == -1
@sub_entries = [] << result unless result.is_a? Array
@sub_entries = @sub_entries.sort_by{ |hash| hash['type'] }