mirror of
https://gitlab.com/bramw/baserow.git
synced 2025-04-30 23:30:02 +00:00
17 lines
427 B
JavaScript
17 lines
427 B
JavaScript
export default (client) => {
|
|
return {
|
|
get(fieldId) {
|
|
return client.get(`/field-permissions/${fieldId}/`)
|
|
},
|
|
update(fieldId, { role, allowInForms }) {
|
|
const data = {}
|
|
if (role !== undefined) {
|
|
data.role = role
|
|
}
|
|
if (allowInForms !== undefined) {
|
|
data.allow_in_forms = allowInForms
|
|
}
|
|
return client.patch(`/field-permissions/${fieldId}/`, data)
|
|
},
|
|
}
|
|
}
|