  :mark-entries-as-read
  [check-spec]
  (fn [{db :db} [_ ids]]
-   {:http-xhrio {:method :put
-                 :uri (str (:url (:server db)) "/elfeed/tags")
-                 :params {:entries ids :remove (list "unread")}
-                 :format (ajax/json-request-format)
-                 :response-format (ajax/json-response-format)
-                 :on-success [:success-mark-entries-as-read ids]
-                 :on-failure [:failure-mark-entries-as-read ids]}
+   {:http-xhrio (merge default-http-xhrio-attrs
+                       {:method :put
+                        :uri (str (:url (:server db)) "/elfeed/tags")
+                        :params {:entries ids :remove (list "unread")}
+                        :on-success [:success-mark-entries-as-read ids]
+                        :on-failure [:failure-mark-entries-as-read ids]})
     :db db}))
 
 (defn success-mark-entries-as-read [db [_event-id entry-ids response]]

     {:db db})))

(defn fetch-entries [{db :db} [_event-id search-params]]
  (let [query-term (js/encodeURIComponent
                    (or (:term search-params) (:default-term search-params)))
        uri (str (:url (:server db)) "/elfeed/search?q=" query-term)]
    {:http-xhrio {:method :post
                  :uri uri
                  :format :text
                  :response-format (ajax/json-response-format {:keywords? true})
                  :keywords? true
                  :on-success [:success-fetch-entries search-params]
                  :on-failure [:failure-fetch-entries]}
     :db (assoc db
                :error-entries false
                :fetching-feeds? true
                :fetching-entries? true)}))

(reg-event-fx
 :fetch-entries

 :mark-entries-as-unread
 [check-spec]
 (fn [{db :db} [_ ids]]
   {:http-xhrio (merge default-http-xhrio-attrs
                       {:method :put
                        :uri (str (:url (:server db)) "/elfeed/tags")
                        :params {:entries ids :add (list "unread")}
                        :on-success [:success-mark-entries-as-unread ids]
                        :on-failure [:failure-mark-entries-as-unread ids]})
    :db db}))

(reg-event-db
