mirror of
https://github.com/baserow/baserow.git
synced 2026-12-05 08:48:35 +00:00
31 lines
814 B
JavaScript
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,
|
|
})
|
|
},
|
|
}
|
|
}
|