mirror of
https://github.com/penpot/penpot.git
synced 2025-05-16 00:16:39 +02: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.spec :as us]
|
||||||
[app.common.uuid :as uuid]
|
[app.common.uuid :as uuid]
|
||||||
[app.db :as db]
|
[app.db :as db]
|
||||||
|
[app.db.sql :as sql]
|
||||||
[app.util.services :as sv]
|
[app.util.services :as sv]
|
||||||
[clojure.spec.alpha :as s]
|
[clojure.spec.alpha :as s]
|
||||||
[cuerdas.core :as str]))
|
[cuerdas.core :as str]))
|
||||||
|
@ -96,18 +97,12 @@
|
||||||
|
|
||||||
profile))
|
profile))
|
||||||
|
|
||||||
|
|
||||||
(def sql:profile-by-email
|
|
||||||
"select * from profile
|
|
||||||
where email=?
|
|
||||||
and deleted_at is null")
|
|
||||||
|
|
||||||
(defn retrieve-profile-data-by-email
|
(defn retrieve-profile-data-by-email
|
||||||
[conn email]
|
[conn email]
|
||||||
(let [email (str/lower email)]
|
(let [sql (sql/select :profile {:email (str/lower email)})
|
||||||
(-> (db/exec-one! conn [sql:profile-by-email email])
|
data (db/exec-one! conn sql)]
|
||||||
(decode-profile-row))))
|
(when (and data (nil? (:deleted-at data)))
|
||||||
|
(decode-profile-row data))))
|
||||||
|
|
||||||
;; --- Attrs Helpers
|
;; --- Attrs Helpers
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue