Skip to content

Commit

Permalink
Refactor get_current_version_from_game_mode/1 function
Browse files Browse the repository at this point in the history
  • Loading branch information
tvillegas98 committed Aug 14, 2024
1 parent cdbbc7d commit 77c5b01
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
3 changes: 2 additions & 1 deletion apps/game_backend/lib/game_backend/configuration.ex
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,8 @@ defmodule GameBackend.Configuration do
def get_current_version_from_game_mode(game_mode) do
q =
from(v in Version,
where: v.current and v.game_mode_id == ^game_mode.id,
join: g in assoc(v, :game_mode),
where: v.current and g.name == ^game_mode,
preload: [
:consumable_items,
:skills,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ defmodule Gateway.Controllers.CurseOfMirra.ConfigurationController do
action_fallback Gateway.Controllers.FallbackController

def get_game_mode_configuration(conn, %{"game_mode" => game_mode}) do
game_mode = Configuration.get_game_mode_by_name(game_mode)
version = Configuration.get_current_version_from_game_mode(game_mode)

config =
Expand Down

0 comments on commit 77c5b01

Please sign in to comment.