1
0
Fork 0
mirror of https://gitlab.com/bramw/baserow.git synced 2025-01-31 03:12:45 +00:00
bramw_baserow/enterprise/web-frontend/modules/baserow_enterprise/services/team.js

35 lines
1,008 B
JavaScript

import baseService from '@baserow/modules/core/crudTable/baseService'
export default (client) => {
return Object.assign(
baseService(
client,
({ workspaceId }) => `/teams/workspace/${workspaceId}/`,
false
),
{
fetchAll(workspaceId) {
return client.get(`/teams/workspace/${workspaceId}/`)
},
create(workspaceId, values) {
return client.post(`/teams/workspace/${workspaceId}/`, values)
},
update(id, values) {
return client.put(`/teams/${id}/`, values)
},
delete(id) {
return client.delete(`/teams/${id}/`)
},
createSubject(teamId, baseUrl, values) {
values.base_url = baseUrl
return client.post(`/teams/${teamId}/subjects/`, values)
},
fetchAllSubjects(teamId) {
return client.get(`/teams/${teamId}/subjects/`)
},
deleteSubject(teamId, subjectId) {
return client.delete(`/teams/${teamId}/subjects/${subjectId}/`)
},
}
)
}