updates.
This commit is contained in:
@@ -36,5 +36,11 @@
|
||||
(let [[session token] (yodlee/get-access-token)]
|
||||
{:status 200
|
||||
:headers {"Content-Type" "application/edn"}
|
||||
:body (pr-str (yodlee/get-accounts)) })))
|
||||
:body (pr-str (yodlee/get-accounts)) }))
|
||||
(POST "/accounts/:id" {:keys [query-params identity] {:keys [id]} :route-params :as request}
|
||||
(assert-admin identity)
|
||||
(let [[session token] (yodlee/get-access-token)]
|
||||
{:status 200
|
||||
:headers {"Content-Type" "application/edn"}
|
||||
:body (pr-str (yodlee/update-yodlee (Long/parseLong id))) })))
|
||||
wrap-secure))
|
||||
|
||||
@@ -57,6 +57,18 @@
|
||||
:on-success [::got-accounts]
|
||||
:on-error [::save-error]}}))
|
||||
|
||||
|
||||
(re-frame/reg-event-fx
|
||||
::kick
|
||||
(fn [{:keys [db]} [_ id]]
|
||||
{:db (assoc-in db [::yodlee] {:accounts-loading? true})
|
||||
:http {:token (:user db)
|
||||
:method :post
|
||||
:headers {"Content-Type" "application/edn"}
|
||||
:uri (str "/api/yodlee/accounts/" id)
|
||||
:on-success [::mounted]
|
||||
:on-error [::save-error]}}))
|
||||
|
||||
(re-frame/reg-event-fx
|
||||
::got-accounts
|
||||
(fn [{:keys [db]} [_ accounts]]
|
||||
@@ -108,7 +120,9 @@
|
||||
[:th "Account Name"]
|
||||
[:th "Account Number"]
|
||||
[:th "Yodlee Account Number"]
|
||||
[:th "Yodlee Last updated"]
|
||||
[:th "Yodlee Status"]]]
|
||||
|
||||
(if @(re-frame/subscribe [::accounts-loading?])
|
||||
[:tr [:td {:col-span "3"} "Loading..."]
|
||||
]
|
||||
@@ -117,7 +131,9 @@
|
||||
[:td (:accountName account)]
|
||||
[:td (:accountNumber account)]
|
||||
[:td (:id account)]
|
||||
[:td (str/join ", " (map :lastUpdated (:dataset account)))]
|
||||
[:td (str/join ", " (map :additionalStatus (:dataset account)))]
|
||||
[:td [:button.button.is-success {:on-click (dispatch-event [::kick (:id account)] )} "Kick." ]]
|
||||
]))]])
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user