mirror of
https://github.com/penpot/penpot.git
synced 2025-01-25 07:58:49 -05:00
✨ Minor improvement on retrieve profile by email fn.
This commit is contained in:
parent
129cc86e3b
commit
61ad112451
1 changed files with 5 additions and 10 deletions
|
@ -13,6 +13,7 @@
|
|||
[app.common.spec :as us]
|
||||
[app.common.uuid :as uuid]
|
||||
[app.db :as db]
|
||||
[app.db.sql :as sql]
|
||||
[app.util.services :as sv]
|
||||
[clojure.spec.alpha :as s]
|
||||
[cuerdas.core :as str]))
|
||||
|
@ -96,18 +97,12 @@
|
|||
|
||||
profile))
|
||||
|
||||
|
||||
(def sql:profile-by-email
|
||||
"select * from profile
|
||||
where email=?
|
||||
and deleted_at is null")
|
||||
|
||||
(defn retrieve-profile-data-by-email
|
||||
[conn email]
|
||||
(let [email (str/lower email)]
|
||||
(-> (db/exec-one! conn [sql:profile-by-email email])
|
||||
(decode-profile-row))))
|
||||
|
||||
(let [sql (sql/select :profile {:email (str/lower email)})
|
||||
data (db/exec-one! conn sql)]
|
||||
(when (and data (nil? (:deleted-at data)))
|
||||
(decode-profile-row data))))
|
||||
|
||||
;; --- Attrs Helpers
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue