1
0
mirror of https://gitlab.com/bramw/baserow.git synced 2024-11-21 23:37:55 +00:00
bramw_baserow/web-frontend/modules/core/services/application.js

30 lines
928 B
JavaScript

export default (client) => {
return {
fetchAll(workspaceId = null) {
const workspaceUrl =
workspaceId !== null ? `workspace/${workspaceId}/` : ''
return client.get(`/applications/${workspaceUrl}`)
},
create(workspaceId, values) {
return client.post(`/applications/workspace/${workspaceId}/`, values)
},
asyncDuplicate(applicationId) {
return client.post(`/applications/${applicationId}/duplicate/async/`)
},
get(applicationId) {
return client.get(`/applications/${applicationId}/`)
},
update(applicationId, values) {
return client.patch(`/applications/${applicationId}/`, values)
},
order(workspaceId, order) {
return client.post(`/applications/workspace/${workspaceId}/order/`, {
application_ids: order,
})
},
delete(applicationId) {
return client.delete(`/applications/${applicationId}/`)
},
}
}