Skip to content

Commit

Permalink
make unsubmitted application viewable after campaign end
Browse files Browse the repository at this point in the history
  • Loading branch information
KavikaPalletenne committed Dec 2, 2024
1 parent 80c1abe commit efe6c00
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions backend/server/src/models/application.rs
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,10 @@ impl Application {
u.zid AS user_zid, u.name AS user_name, u.gender AS user_gender,
u.pronouns AS user_pronouns, u.degree_name AS user_degree_name,
u.degree_starting_year AS user_degree_starting_year
FROM applications a JOIN users u ON u.id = a.user_id
WHERE a.id = $1 AND a.submitted = true
FROM applications a
JOIN users u ON u.id = a.user_id
JOIN campaigns c ON c.id = a.campaign_id
WHERE a.id = $1 AND (a.submitted = true OR c.ends_at <= CURRENT_TIMESTAMP)
",
id
)
Expand Down Expand Up @@ -201,8 +203,11 @@ impl Application {
u.zid AS user_zid, u.name AS user_name, u.gender AS user_gender,
u.pronouns AS user_pronouns, u.degree_name AS user_degree_name,
u.degree_starting_year AS user_degree_starting_year
FROM applications a JOIN users u ON u.id = a.user_id JOIN application_roles ar on ar.application_id = a.id
WHERE ar.id = $1 AND a.submitted = true
FROM applications a
JOIN users u ON u.id = a.user_id
JOIN application_roles ar on ar.application_id = a.id
JOIN campaigns c on c.id = a.campaign_id
WHERE ar.id = $1 AND (a.submitted = true OR c.ends_at <= CURRENT_TIMESTAMP)
",
role_id
)
Expand Down Expand Up @@ -265,8 +270,10 @@ impl Application {
u.zid AS user_zid, u.name AS user_name, u.gender AS user_gender,
u.pronouns AS user_pronouns, u.degree_name AS user_degree_name,
u.degree_starting_year AS user_degree_starting_year
FROM applications a JOIN users u ON u.id = a.user_id
WHERE a.campaign_id = $1 AND a.submitted = true
FROM applications a
JOIN users u ON u.id = a.user_id
JOIN campaigns c ON c.id = a.campaign_id
WHERE a.campaign_id = $1 AND (a.submitted = true OR c.ends_at <= CURRENT_TIMESTAMP)
",
campaign_id
)
Expand Down

0 comments on commit efe6c00

Please sign in to comment.