Skip to content

Commit

Permalink
fix an issue with user count when not logged
Browse files Browse the repository at this point in the history
  • Loading branch information
syphax-bouazzouni committed Jan 23, 2025
1 parent f682b18 commit d46f0a2
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/helpers/admin_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ def action_button(name, link, method: :post, class_style: 'btn btn-link')
def user_count
user_count = LinkedData::Client::HTTP.get(Admin::LogsController::USERS_QUERY_COUNT.dup, {}, raw: true)
user_count = MultiJson.load(user_count)
return [] if user_count.is_a?(Hash) && user_count['errors']

user_count.sort_by! { |uc| uc['count'] }.reverse!
user_count.map! { |uc| [uc['user'].split('/').last, uc['count']] }.to_h
end
Expand Down

0 comments on commit d46f0a2

Please sign in to comment.