Skip to content

Instantly share code, notes, and snippets.

@kenbier
Last active December 20, 2016 22:53
Show Gist options
  • Save kenbier/f2667be66a7a79bc0a5ab845d81002a2 to your computer and use it in GitHub Desktop.
Save kenbier/f2667be66a7a79bc0a5ab845d81002a2 to your computer and use it in GitHub Desktop.
(defmethod api-mutate 'support-request/new
[{:keys [blob-store twarc-scheduler
database current/user] :as env}
q
{:keys [history comment support-id] :as params}]
{:action (fn []
(let [{:keys [db/id user/email]} user
connection (db/get-connection database)
session {:history history
:comment comment}]
;; Store the user session.
(kv/store blob-store support-id session)
;; Store the key to the user session.
@(d/transact connection [[:db/add id :user/sessions support-id]])
;; Sumologic will search for this log.
(timbre/error "new support request recorded:" email support-id comment)
support-id))})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment