Last active
December 20, 2016 22:53
-
-
Save kenbier/f2667be66a7a79bc0a5ab845d81002a2 to your computer and use it in GitHub Desktop.
Revisions
-
kenbier revised this gist
Dec 20, 2016 . 1 changed file with 2 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -4,7 +4,7 @@ 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}] @@ -14,6 +14,5 @@ ;; 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))}) -
kenbier revised this gist
Dec 20, 2016 . 1 changed file with 6 additions and 9 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,22 +1,19 @@ (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/adstage-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:" (:user/email user) support-id comment) support-id))}) -
kenbier revised this gist
Dec 20, 2016 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,4 @@ (defusecase api-mutate 'support-request/new with policy/existence [{:keys [blob-store twarc-scheduler database current/user] :as env} q {:keys [history comment support-id] :as params}] -
kenbier revised this gist
Dec 20, 2016 . 1 changed file with 7 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,18 +1,22 @@ (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/adstage-id user/email]} user ;; Use the users email as the comment if it is missing. support-comment (or comment email "") connection (db/get-connection database) session {:history history :comment support-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:" (:user/email user) support-id comment) support-id))}) -
kenbier revised this gist
Nov 6, 2016 . 1 changed file with 0 additions and 14 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,17 +1,3 @@ (defusecase api-mutate 'support-request/new with policy/existence [{:keys [blob-store twarc-scheduler database current/user] :as env} q -
kenbier created this gist
Nov 6, 2016 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,32 @@ (ns arc.use-cases.support-request-new (:require [arc.api.helper :refer :all] [arc.use-cases :refer [api-mutate api-read]] [arc.util :refer [inspect] :as util] [arc.helpers :as h] [arc.components.key-value-store :as kv] [datomic.api :as d] [lib.policy :as policy] [lib.use-case :refer [defusecase]] [untangled.datomic.protocols :as db] [taoensso.timbre :as timbre] [arc.jobs.check-invariants :as ci])) (defusecase api-mutate 'support-request/new with policy/existence [{: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/adstage-id user/email]} user ;; use the users email as the comment if it is missing. support-comment (or comment email "") connection (db/get-connection database) session {:history history :comment support-comment}] (kv/store blob-store support-id session) @(d/transact connection [[:db/add id :user/sessions support-id]]) (timbre/error "new support request recorded:" (:user/email user) support-id comment) (ci/perform-async twarc-scheduler support-id) support-id))})