1
0
mirror of https://gitlab.com/bramw/baserow.git synced 2024-11-21 23:37:55 +00:00
bramw_baserow/web-frontend/modules/builder/services/page.js
2023-04-11 13:41:43 +00:00

26 lines
652 B
JavaScript

export default (client) => {
return {
create(builderId, name, path, pathParams = {}) {
return client.post(`builder/${builderId}/pages/`, {
name,
path,
path_params: pathParams,
})
},
update(pageId, values) {
return client.patch(`builder/pages/${pageId}/`, values)
},
delete(pageId) {
return client.delete(`builder/pages/${pageId}/`)
},
order(builderId, order) {
return client.post(`/builder/${builderId}/pages/order/`, {
page_ids: order,
})
},
duplicate(pageId) {
return client.post(`/builder/pages/${pageId}/duplicate/async/`)
},
}
}