Created
October 20, 2012 02:28
-
-
Save anonymous/3921746 to your computer and use it in GitHub Desktop.
This file contains 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 edit-user! [{:keys [username old-name password]}] | |
(let [user {:username username :password password}] | |
(if (= username old-name) | |
(when (valid-psw? password) | |
(let [{uname :username}] | |
(-> user (repo/upsert :users) )))))) ;calling function | |
(defn upsert ([model condition document-fields | |
& {:keys [upsert] :or {upsert false}}] | |
(mc/update model condition document-fields upsert)) | |
([model document-fields & {:keys [upsert] :or {upsert false}}] | |
mc/update document-fields upsert)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment