diff --git a/src/main/frontend/events.cljs b/src/main/frontend/events.cljs index 1c6203b..54f59d4 100644 --- a/src/main/frontend/events.cljs +++ b/src/main/frontend/events.cljs @@ -40,7 +40,7 @@ :timeout 10000 :response-content-types {#"application/.*json" :json} :on-success [:get-page-success] - :on-failure [:initialize-db]} + :on-failure [:get-page-failure]} :db (-> db (assoc-in [:loading :post] true))})) @@ -52,6 +52,13 @@ (assoc-in [:loading :post] false) (assoc :post body)))) +(reg-event-db + :get-page-failure + (fn [db [_ {body :body}]] + (-> db + (assoc-in [:loading :post] false) + (assoc :post body)))) + (reg-event-db :initialize-db (fn [_ _]