Show errors
This commit is contained in:
parent
72458e5810
commit
9ec247fe59
|
@ -46,14 +46,16 @@
|
||||||
:format (ajax/json-request-format)
|
:format (ajax/json-request-format)
|
||||||
:response-format (ajax/json-response-format)
|
:response-format (ajax/json-response-format)
|
||||||
:on-success [:set-transcription]
|
:on-success [:set-transcription]
|
||||||
:on-failure [:bad-transcription]}})))
|
:on-failure [:bad-transcription]}
|
||||||
|
:db (dissoc (dissoc db :transcription) :common/error)})))
|
||||||
|
|
||||||
(rf/reg-event-fx
|
(rf/reg-event-fx
|
||||||
:bad-transcription
|
:bad-transcription
|
||||||
(fn
|
(fn
|
||||||
[{db :db} [_ response]]
|
[{db :db} [_ response]]
|
||||||
;; TODO: signal something has failed? It doesn't matter very much, unless it keeps failing.
|
;; TODO: signal something has failed? It doesn't matter very much, unless it keeps failing.
|
||||||
(js/console.log (str "Failed to fetch transcription data" response))))
|
(js/console.log (str "Failed to fetch transcription data" response))
|
||||||
|
(assoc db :common/error response)))
|
||||||
|
|
||||||
(rf/reg-event-db
|
(rf/reg-event-db
|
||||||
:common/set-error
|
:common/set-error
|
||||||
|
|
|
@ -30,5 +30,8 @@
|
||||||
[b/Row]
|
[b/Row]
|
||||||
[b/Row
|
[b/Row
|
||||||
[:div.col-sm-12
|
[:div.col-sm-12
|
||||||
[b/Alert {:color "success"} @(rf/subscribe [:transcription])]]]]])
|
[b/Alert {:color "success"} @(rf/subscribe [:transcription])]]]
|
||||||
|
[b/Row
|
||||||
|
[:div.col-sm-12
|
||||||
|
[b/Alert {:color "warning"} @(rf/subscribe [:common/error])]]]]])
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue