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 characters
(om/transact! reconciler `[(support-request/new ~support-request)]) |
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 characters
(defonce app (atom nil)) | |
(defn on-app-started [{:keys [networking initial-state] :as app}] | |
(let [reconciler (:reconciler app)] | |
(when st/airbrake-client | |
(.addFilter st/airbrake-client | |
(fn [notice] | |
(let [comment (some->> notice | |
.-errors | |
first |
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 characters
(defn with-auth-token | |
"Token wrapper for calls to report-center production server. Gets the | |
token from the url params" | |
[request] | |
(assoc-in request | |
[:headers "Authorization"] | |
(str "Bearer " (core/get-url-param "token")))) | |
(defn start-untangled-support-viewer | |
"Create and display a new untangled support viewer on the given app root, with VCR controls to browse through the given history. The support HTML file must include |
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 characters
(defmethod api-read :support-request | |
[env k {:keys [id] :as params}] | |
(let [{:keys [current/user blob-store]} env] | |
{:value (kv/fetch blob-store | |
(java.util.UUID/fromString id))})) | |
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 characters
(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}] |
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 characters
(defmethod m/mutate 'support-request/new | |
[{:keys [ast state]} k {:keys [comment support-id]}] | |
{:remote (assoc ast :params {:comment comment | |
:support-id support-id | |
:history (uc/history @app/app)})}) |