From 0c4e634c44f52025dd4d8b8b26038f023a9ecc3b Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Tue, 15 Mar 2016 22:24:29 +0200 Subject: [PATCH] Add page create and update repo methods. --- src/uxbox/repo/projects.cljs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/uxbox/repo/projects.cljs b/src/uxbox/repo/projects.cljs index a222de2299..05411a1cb3 100644 --- a/src/uxbox/repo/projects.cljs +++ b/src/uxbox/repo/projects.cljs @@ -25,3 +25,17 @@ (defmethod urc/-do :fetch/pages [type data] (urc/req! {:url (str urc/+uri+ "/pages") :method :get})) + +(defmethod urc/-do :create/page + [type {:keys [id] :as data}] + (let [params {:url (str urc/+uri+ "/pages") + :method :post + :body data}] + (urc/req! params))) + +(defmethod urc/-do :update/page + [type {:keys [id] :as data}] + (let [params {:url (str urc/+uri+ "/pages/" id) + :method :put + :body data}] + (urc/req! params)))