From fb2e04e39a9fec694f69a2062cdf7caf1c9bbe82 Mon Sep 17 00:00:00 2001 From: Mario Trost Date: Tue, 17 Sep 2024 22:05:55 +0200 Subject: [PATCH] Adds uid to event data --- src/co/gaiwan/compass/routes/sessions.clj | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/co/gaiwan/compass/routes/sessions.clj b/src/co/gaiwan/compass/routes/sessions.clj index cdf0057..d16fc6e 100644 --- a/src/co/gaiwan/compass/routes/sessions.clj +++ b/src/co/gaiwan/compass/routes/sessions.clj @@ -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) @@ -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)