about summary refs log tree commit diff
path: root/users/grfn/bbbg
diff options
context:
space:
mode:
authorGriffin Smith <grfn@gws.fyi>2021-12-30T00·19-0500
committerclbot <clbot@tvl.fyi>2021-12-30T00·21+0000
commit89084c5696e332d8bcc68ca617c147eed65fdf9f (patch)
treeafede8f4e30ae7622123a2b78d1dc0ddd3f3b3d9 /users/grfn/bbbg
parent7a21189e0deb7ccb5556c194c379e920d0464778 (diff)
feat(grfn/bbbg): Filter signup form by rsvpd attending r/3503
Change-Id: Icf40fb125cc3fe9e1c70de2ac253d70349a213d2
Reviewed-on: https://cl.tvl.fyi/c/depot/+/4743
Reviewed-by: grfn <grfn@gws.fyi>
Autosubmit: grfn <grfn@gws.fyi>
Tested-by: BuildkiteCI
Diffstat (limited to 'users/grfn/bbbg')
-rw-r--r--users/grfn/bbbg/src/bbbg/handlers/signup_form.clj37
1 files changed, 20 insertions, 17 deletions
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)))))