Commit 9410d2b1f2b708ea5a02af8afda1ea8ed23a57b5

Thomas de Grivel 2022-02-01T02:02:52

fix list_all_users and list_all_repositories

diff --git a/lib/kmxgit/repository_manager.ex b/lib/kmxgit/repository_manager.ex
index b154719..8e010bc 100644
--- a/lib/kmxgit/repository_manager.ex
+++ b/lib/kmxgit/repository_manager.ex
@@ -23,6 +23,7 @@ defmodule Kmxgit.RepositoryManager do
     |> preload([members: :slug,
                organisation: [:slug, users: :slug],
                user: :slug])
+    |> Repo.all()
   end
 
   def list_repositories(params \\ %IndexParams{}) do
diff --git a/lib/kmxgit/user_manager.ex b/lib/kmxgit/user_manager.ex
index 1df8014..760a207 100644
--- a/lib/kmxgit/user_manager.ex
+++ b/lib/kmxgit/user_manager.ex
@@ -15,6 +15,8 @@ defmodule Kmxgit.UserManager do
     from(u in User)
     |> join(:inner, [u], s in Slug, on: s.user_id == u.id)
     |> order_by([u, s], fragment("lower(?)", s.slug))
+    |> preload(:slug)
+    |> Repo.all()
   end
 
   def list_users(params \\ %IndexParams{}) do