Skip to content

Instantly share code, notes, and snippets.

@jtackett
Created September 28, 2015 02:15
Show Gist options
  • Save jtackett/7178994e186683d8a558 to your computer and use it in GitHub Desktop.
Save jtackett/7178994e186683d8a558 to your computer and use it in GitHub Desktop.
(defn confirm-edit
"All required fields present. confirm-Edit field/values."
[input]
(cond
(true? (:cancel? input)) ;; Did the user cancel?
{:new-state :initial
:response (str "The updates have been canceled.
Please send us more information to save.")}
;; The data has been confirmed
(true? (:confirm? input)) ;; Did the user confirm the data?
{:new-state :salesforce-write
:response (str "Thank you for confirming the data for us.
We are now writing your data to Salesforce.
We will let you know when it is finished.")
:launch-sf-write true}
;; Default
:else
{:new-state :confirm-edit
:response (str "Please edit and confirm the following fields for us: "
(util/display-fields-values input)
"Are these fields correct now?")}))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment