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/integration.js
2023-06-22 14:23:00 +00:00

31 lines
822 B
JavaScript

export default (client) => {
return {
fetchAll(applicationId) {
return client.get(`application/${applicationId}/integrations/`)
},
create(applicationId, integrationType, values, beforeId = null) {
const payload = {
type: integrationType,
...values,
}
if (beforeId !== null) {
payload.before_id = beforeId
}
return client.post(`application/${applicationId}/integrations/`, payload)
},
update(integrationId, values) {
return client.patch(`integration/${integrationId}/`, values)
},
delete(integrationId) {
return client.delete(`integration/${integrationId}/`)
},
move(integrationId, beforeId) {
return client.patch(`integration/${integrationId}/move/`, {
before_id: beforeId,
})
},
}
}