From 89084c5696e332d8bcc68ca617c147eed65fdf9f Mon Sep 17 00:00:00 2001 From: Griffin Smith Date: Wed, 29 Dec 2021 19:19:19 -0500 Subject: feat(grfn/bbbg): Filter signup form by rsvpd attending Change-Id: Icf40fb125cc3fe9e1c70de2ac253d70349a213d2 Reviewed-on: https://cl.tvl.fyi/c/depot/+/4743 Reviewed-by: grfn Autosubmit: grfn Tested-by: BuildkiteCI --- users/grfn/bbbg/src/bbbg/handlers/signup_form.clj | 37 ++++++++++++----------- 1 file changed, 20 insertions(+), 17 deletions(-) (limited to 'users/grfn') diff --git a/users/grfn/bbbg/src/bbbg/handlers/signup_form.clj b/users/grfn/bbbg/src/bbbg/handlers/signup_form.clj index f2c405c9ca86..ed1d7644f539 100644 --- a/users/grfn/bbbg/src/bbbg/handlers/signup_form.clj +++ b/users/grfn/bbbg/src/bbbg/handlers/signup_form.clj @@ -70,21 +70,24 @@ (defn signup-form-routes [{:keys [db]}] (context "/signup-forms" [] - (GET "/" request - (if-let [event (db/fetch db (db.event/today))] - (redirect (str "/signup-forms/" (::event/id event))) - (page-response (no-events-page - {:authenticated? (authenticated? request)})))) + (GET "/" request + (if-let [event (db/fetch db (db.event/today))] + (redirect (str "/signup-forms/" (::event/id event))) + (page-response (no-events-page + {:authenticated? (authenticated? request)})))) - (GET "/:event-id" [event-id] - (if-let [event (db/get db :event event-id)] - (let [attendees (db/list db - (-> - (db.attendee/for-event event-id) - (merge-where [:or - [:= :attended nil] - [:not :attended]])))] - (page-response - (signup-page {:event event - :attendees attendees}))) - (event-not-found))))) + (GET "/:event-id" [event-id] + (if-let [event (db/get db :event event-id)] + (let [attendees (db/list db + (-> + (db.attendee/for-event event-id) + (merge-where + [:and + [:or + [:= :attended nil] + [:not :attended]] + :rsvpd_attending])))] + (page-response + (signup-page {:event event + :attendees attendees}))) + (event-not-found))))) -- cgit 1.4.1