Makes yodlee edit work again
This commit is contained in:
@@ -14,7 +14,8 @@
|
||||
[bidi.bidi :as bidi]
|
||||
[config.core :refer [env]]
|
||||
[datomic.api :as dc]
|
||||
[hiccup2.core :as hiccup]))
|
||||
[hiccup2.core :as hiccup]
|
||||
[auto-ap.datomic :refer [pull-attr]]))
|
||||
|
||||
(def default-read '[:db/id
|
||||
:yodlee-provider-account/last-updated
|
||||
@@ -47,6 +48,35 @@ fastlink.open({fastLinkURL: '%s',
|
||||
]
|
||||
[:div]))))
|
||||
|
||||
(defn reauthenticate [{:keys [session form-params]}]
|
||||
(html-response
|
||||
(com/modal
|
||||
{}
|
||||
(com/modal-card
|
||||
{}
|
||||
[:div.flex [:div.p-2 "Yodlee Fastlink"] ]
|
||||
[:div
|
||||
[:div#fa-spot]
|
||||
[:script {:lang "text/javascript"}
|
||||
(hiccup/raw
|
||||
(format "
|
||||
fastlink.open({fastLinkURL: '%s',
|
||||
accessToken: '%s',
|
||||
params: {'configName': 'Aggregation',
|
||||
'providerAccountId': %d,
|
||||
'flow': 'edit'}},
|
||||
'fa-spot');
|
||||
|
||||
"
|
||||
(:yodlee2-fastlink env)
|
||||
(yodlee/get-access-token (-> (pull-attr (dc/db conn)
|
||||
{:yodlee-provider-account/client [:client/code]}
|
||||
(Long/parseLong (get form-params "id")))
|
||||
:yodlee-provider-account/client
|
||||
:client/code))
|
||||
(pull-attr (dc/db conn) :yodlee-provider-account/id (Long/parseLong (get form-params "id")))))]]
|
||||
[:div]))))
|
||||
|
||||
(def grid-page {:id "yodlee-table"
|
||||
:nav (com/company-aside-nav)
|
||||
:id-fn :db/id
|
||||
@@ -71,7 +101,13 @@ fastlink.open({fastLinkURL: '%s',
|
||||
(com/button-icon {} svg/refresh)
|
||||
"Link new account")])
|
||||
:row-buttons (fn [user e]
|
||||
[(when (is-admin? user)
|
||||
[
|
||||
(com/button {:hx-put (bidi/path-for ssr-routes/only-routes
|
||||
:company-yodlee-provider-account-reauthenticate)
|
||||
:color :primary
|
||||
:hx-target "#modal-holder"}
|
||||
"Reauthenticate")
|
||||
(when (is-admin? user)
|
||||
(com/icon-button {:hx-put (bidi/path-for ssr-routes/only-routes
|
||||
:company-yodlee-provider-account-refresh)
|
||||
:hx-target "closest tr"}
|
||||
|
||||
Reference in New Issue
Block a user