Skip to content

Commit

Permalink
Adds uid to event data
Browse files Browse the repository at this point in the history
  • Loading branch information
MTrost committed Sep 17, 2024
1 parent 689d700 commit fb2e04e
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/co/gaiwan/compass/routes/sessions.clj
Original file line number Diff line number Diff line change
Expand Up @@ -213,11 +213,12 @@
(time/format "yyyyMMdd'T'HHmmss" time))

(defn generate-icalendar [event]
(let [{:keys [title description location start-time end-time]} event]
(let [{:keys [uid title description location start-time end-time]} event]
(str/join "\r\n"
["BEGIN:VCALENDAR"
"VERSION:2.0"
"BEGIN:VEVENT"
(str "UID:" uid)
(str "SUMMARY:" title)
(str "DESCRIPTION:" description)
(str "LOCATION:" location)
Expand All @@ -234,8 +235,10 @@
(defn GET-add-to-calendar-handler [req]
(let [session-eid (parse-long (get-in req [:path-params :id]))
{:session/keys [title description
location time duration]} (q/session session-eid)
event {:title title
location time duration]
:as session} (q/session session-eid)
event {:uid (str (:db/id session) "@heart_of_clojure_2024")
:title title
:description (when description (subs description 0 (min (count description) 50)))
:location (:location/name location)
:start-time (format-datetime time)
Expand Down

0 comments on commit fb2e04e

Please sign in to comment.