From cdddbe50ceacc5dbb24b6b7149f0e98a7d77f689 Mon Sep 17 00:00:00 2001 From: Adrian Salamon Date: Mon, 30 Sep 2024 13:21:50 +0200 Subject: [PATCH 1/2] order applications by updated at --- lib/haj/applications.ex | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/haj/applications.ex b/lib/haj/applications.ex index ad7d091..6133467 100644 --- a/lib/haj/applications.ex +++ b/lib/haj/applications.ex @@ -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 @@ -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 From 19605150376d3e23d9a59753569b3521820f77fa Mon Sep 17 00:00:00 2001 From: Adrian Salamon Date: Mon, 30 Sep 2024 13:28:12 +0200 Subject: [PATCH 2/2] update deploy env vars --- config/runtime.exs | 2 +- fly.production.toml | 2 ++ fly.staging.toml | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/config/runtime.exs b/config/runtime.exs index 090b08b..5d94143 100644 --- a/config/runtime.exs +++ b/config/runtime.exs @@ -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, diff --git a/fly.production.toml b/fly.production.toml index 51037e9..17bc634 100644 --- a/fly.production.toml +++ b/fly.production.toml @@ -13,6 +13,8 @@ processes = [] [env] PHX_HOST = "haj.metaspexet.se" + LOGIN_HOST = "login.datasektionen.se" + ZFINGER_URL = "d2imehpdli8mvq.cloudfront.net" PORT = "8080" [experimental] diff --git a/fly.staging.toml b/fly.staging.toml index c392760..c343c7b 100644 --- a/fly.staging.toml +++ b/fly.staging.toml @@ -13,6 +13,8 @@ processes = [] [env] PHX_HOST = "betaspexet.se" + LOGIN_HOST = "login.datasektionen.se" + ZFINGER_URL = "d2imehpdli8mvq.cloudfront.net" PORT = "8080" [experimental]