Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Order applications by updated at #91

Merged
merged 2 commits into from
Sep 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading