FIX updat sub entries api

dev_forge
Jasder 5 years ago
parent c6cd3a5720
commit 48ea06ec8a

@ -15,6 +15,7 @@ class RepositoriesController < ApplicationController
interactor = Repositories::EntriesInteractor.call(@user, @repo.identifier, params[:filepath], ref: params[:ref])
if interactor.success?
@sub_entries = interactor.result
@sub_entries = [] << @sub_entries unless @sub_entries.is_a? Array
else
render_error(interactor.error)
end

@ -1,7 +1,3 @@
if @sub_entries.is_a? Array
json.array! @sub_entries do |entry|
json.partial! 'repositories/simple_entry', locals: { entry: entry }
end
else
json.partial! 'repositories/simple_entry', locals: { entry: @sub_entries }
json.array! @sub_entries do |entry|
json.partial! 'repositories/simple_entry', locals: { entry: entry }
end

Loading…
Cancel
Save