fix(grfn/bbbg): Handle attended=NULL in typeahead

Change-Id: I000f115298dc8d3c18b5c0a6581e5423aa6892e7
This commit is contained in:
Griffin Smith 2021-12-13 22:05:41 -05:00
parent 8bc2e83246
commit e7899e6c0b

View file

@ -21,9 +21,11 @@
(db.attendee/search q)
{:select [:attendee.*] :from [:attendee]})
event_id (db.attendee/for-event event_id)
(some? attended) (merge-where [:= :attended (case attended
"true" true
"false" false)])))]
(some? attended)
(merge-where
(case attended
"true" :attended
"false" [:or [:= :attended nil] [:not :attended]]))))]
(-> {:results results}
json/generate-string
response