diff --git a/src/main/blog/db.cljs b/src/main/blog/db.cljs index 038a69c..ed98492 100644 --- a/src/main/blog/db.cljs +++ b/src/main/blog/db.cljs @@ -60,3 +60,18 @@ (catch js/Error err (js/console.log (ex-cause err))))) channel) +(defn delete-article + "Delete an article and return the id via channel. It gets and returns the same channel." + [client id channel] + (go + (try + (let [res (
js [id])))] + (>! channel (-> (.-rows res) + (js->clj :keywordize-keys true) + (first) + (:id)))) + (catch js/Error err (js/console.log (ex-cause err))))) + channel) +