diff --git a/backend/src/app/main.clj b/backend/src/app/main.clj index 678ef5cfc6..4e256d5cf3 100644 --- a/backend/src/app/main.clj +++ b/backend/src/app/main.clj @@ -319,6 +319,7 @@ {::http.client/client (ig/ref ::http.client/client) ::db/pool (ig/ref ::db/pool) ::rds/pool (ig/ref ::rds/pool) + :app.nitrate/instance (ig/ref :app.nitrate/instance) ::wrk/executor (ig/ref ::wrk/netty-executor) ::session/manager (ig/ref ::session/manager) ::ldap/provider (ig/ref ::ldap/provider) @@ -335,6 +336,9 @@ ::email/blacklist (ig/ref ::email/blacklist) ::email/whitelist (ig/ref ::email/whitelist)} + :app.nitrate/instance + {::http.client/client (ig/ref ::http.client/client)} + :app.rpc/management-methods {::http.client/client (ig/ref ::http.client/client) ::db/pool (ig/ref ::db/pool) diff --git a/backend/src/app/rpc/commands/profile.clj b/backend/src/app/rpc/commands/profile.clj index 4207db2d22..cf3ad6040f 100644 --- a/backend/src/app/rpc/commands/profile.clj +++ b/backend/src/app/rpc/commands/profile.clj @@ -18,6 +18,7 @@ [app.db.sql :as-alias sql] [app.email :as eml] [app.http.session :as session] + [app.nitrate :as nitrate] [app.loggers.audit :as audit] [app.main :as-alias main] [app.media :as media] @@ -98,9 +99,14 @@ ;; no profile-id is in session, and when db call raises not found. In all other ;; cases we need to reraise the exception. (try - (-> (get-profile pool profile-id) - (strip-private-attrs) - (update :props filter-props)) + (let [nitrate (get cfg ::nitrate/instance) + + ;; org ((get nitrate :get-organization) profile-id) + ;; org (nitrate/call cfg :get-organization {:profile-id profile-id}) + + (-> (get-profile pool profile-id) + (strip-private-attrs) + (update :props filter-props))) (catch Throwable _ {:id uuid/zero :fullname "Anonymous User"})))