mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
29 lines
627 B
CoffeeScript
29 lines
627 B
CoffeeScript
define [
|
|
"base"
|
|
], (App) ->
|
|
App.factory "projectMembers", ["ide", "$http", (ide, $http) ->
|
|
return {
|
|
removeMember: (member) ->
|
|
$http({
|
|
url: "/project/#{ide.project_id}/users/#{member._id}"
|
|
method: "DELETE"
|
|
headers:
|
|
"X-Csrf-Token": window.csrfToken
|
|
})
|
|
|
|
addGroup: (group_id, privileges) ->
|
|
$http.post("/project/#{ide.project_id}/group", {
|
|
group_id: group_id
|
|
privileges: privileges
|
|
_csrf: window.csrfToken
|
|
})
|
|
|
|
getMembers: () ->
|
|
$http.get("/project/#{ide.project_id}/members", {
|
|
json: true
|
|
headers:
|
|
"X-Csrf-Token": window.csrfToken
|
|
})
|
|
|
|
}
|
|
]
|