fix: show user doesn't exist error when inviting wrong email

This commit is contained in:
Tienson Qin
2026-02-06 14:57:35 +08:00
parent 11bd281987
commit ee30d51c46

View File

@@ -377,11 +377,14 @@
repo graph-uuid email))]
(notification/show! "Invitation sent!" :success))
(p/catch (fn [e]
(notification/show! "Something wrong, please try again." :error)
(log/error :db-sync/invite-email-failed
{:error e
:graph-uuid graph-uuid
:email email}))))
(if (= "user not found" (get-in (ex-data e) [:body :error]))
(notification/show! "User doesn't exist yet." :warning)
(do
(notification/show! "Something wrong, please try again." :error)
(log/error :db-sync/invite-email-failed
{:error e
:graph-uuid graph-uuid
:email email}))))))
(p/rejected (ex-info "db-sync missing invite info"
{:type :db-sync/invalid-invite
:graph-uuid graph-uuid