From 63bcae9dc1edb7349ae0c68b5867ab27cb6d5bb7 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Thu, 17 Mar 2016 22:23:29 +0200 Subject: [PATCH] Add create/delete project repository methods. --- src/uxbox/repo/projects.cljs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/uxbox/repo/projects.cljs b/src/uxbox/repo/projects.cljs index dc07d8fee..284ec9e20 100644 --- a/src/uxbox/repo/projects.cljs +++ b/src/uxbox/repo/projects.cljs @@ -26,6 +26,19 @@ [type data] (urc/req! {:url (str urc/url "/pages") :method :get})) +(defmethod urc/-do :create/project + [_ data] + (let [params {:url (str urc/url "/projects") + :method :post + :body data}] + (urc/req! params))) + +(defmethod urc/-do :delete/project + [_ {:keys [id]}] + (let [params {:url (str urc/url "/projects/" id) + :method :delete}] + (urc/req! params))) + (defmethod urc/-do :create/page [type {:keys [id] :as data}] (let [params {:url (str urc/url "/pages")