0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-02-13 10:38:13 -05:00

Add page create and update repo methods.

This commit is contained in:
Andrey Antukh 2016-03-15 22:24:29 +02:00
parent 3353c69a51
commit 0c4e634c44

View file

@ -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)))