From eec32aa38a8762eccc8575a37a628bd5ae2cc1d0 Mon Sep 17 00:00:00 2001 From: "Elizabeth (Lizzy) Hunt" Date: Mon, 29 May 2023 16:28:27 -0700 Subject: Bots (#23) * squash all the things for bots * fix warnings * change colors a bit and README updates * fix frontend warnings --- lib/chessh/ssh/client/menus/game_selector.ex | 24 ------------------------ 1 file changed, 24 deletions(-) delete mode 100644 lib/chessh/ssh/client/menus/game_selector.ex (limited to 'lib/chessh/ssh/client/menus/game_selector.ex') diff --git a/lib/chessh/ssh/client/menus/game_selector.ex b/lib/chessh/ssh/client/menus/game_selector.ex deleted file mode 100644 index 7792082..0000000 --- a/lib/chessh/ssh/client/menus/game_selector.ex +++ /dev/null @@ -1,24 +0,0 @@ -defmodule Chessh.SSH.Client.GameSelector do - import Ecto.Query - alias Chessh.Repo - - def paginate_ish_query(query, current_id, direction) do - sorted_query = - if direction == :desc, - do: from(g in query, order_by: [desc: g.id]), - else: from(g in query, order_by: [asc: g.id]) - - results = - if !is_nil(current_id) do - if direction == :desc, - do: from(g in sorted_query, where: g.id < ^current_id), - else: from(g in sorted_query, where: g.id > ^current_id) - else - sorted_query - end - |> Repo.all() - |> Repo.preload([:light_player, :dark_player]) - - if direction == :desc, do: results, else: Enum.reverse(results) - end -end -- cgit v1.3