Files
baserow/web-frontend/modules/core/services/userSource.js
T

31 lines
814 B
JavaScript

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