Skip to content

Commit

Permalink
Order applications by updated at (#91)
Browse files Browse the repository at this point in the history
* order applications by updated at

* update deploy env vars
  • Loading branch information
adriansalamon authored Sep 30, 2024
1 parent 2b4b40e commit 8e384b5
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion config/runtime.exs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ if config_env() == :prod || config_env() == :staging do
login_api_key = System.get_env("LOGIN_API_KEY") || raise "LOGIN_API_KEY is missing"
login_host = System.get_env("LOGIN_HOST") || raise "LOGIN_HOST is missing"
api_login_secret = System.get_env("API_LOGIN_SECRET") || raise "API_LOGIN_SECRET is missing"
zfinger_url = System.get_env("ZFINGER_URL") || "zfinger.datasektionen.se"
zfinger_url = System.get_env("ZFINGER_URL") || raise "ZFINGER_URL is missing"
spam_api_key = System.get_env("SPAM_API_KEY") || raise "SPAM_API_KEY is missing"

config :haj,
Expand Down
2 changes: 2 additions & 0 deletions fly.production.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ processes = []

[env]
PHX_HOST = "haj.metaspexet.se"
LOGIN_HOST = "login.datasektionen.se"
ZFINGER_URL = "d2imehpdli8mvq.cloudfront.net"
PORT = "8080"

[experimental]
Expand Down
2 changes: 2 additions & 0 deletions fly.staging.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ processes = []

[env]
PHX_HOST = "betaspexet.se"
LOGIN_HOST = "login.datasektionen.se"
ZFINGER_URL = "d2imehpdli8mvq.cloudfront.net"
PORT = "8080"

[experimental]
Expand Down
6 changes: 4 additions & 2 deletions lib/haj/applications.ex
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,8 @@ defmodule Haj.Applications do
join: asg in assoc(a, :application_show_groups),
where: asg.application_id == a.id,
where: asg.show_group_id == ^show_group_id and a.status == ^:submitted,
preload: [user: [], application_show_groups: [show_group: [group: []]]]
preload: [user: [], application_show_groups: [show_group: [group: []]]],
order_by: [asc: a.updated_at]

Repo.all(query)
end
Expand Down Expand Up @@ -202,7 +203,8 @@ defmodule Haj.Applications do
query =
from a in App,
where: a.show_id == ^show_id and a.status == ^:submitted,
preload: [application_show_groups: [show_group: [group: []]], user: []]
preload: [application_show_groups: [show_group: [group: []]], user: []],
order_by: [asc: a.updated_at]

Repo.all(query)
end
Expand Down

0 comments on commit 8e384b5

Please sign in to comment.