mirror of
https://github.com/overleaf/overleaf.git
synced 2024-10-31 21:21:03 -04:00
35 lines
776 B
CoffeeScript
35 lines
776 B
CoffeeScript
define [
|
|
"base"
|
|
], (App) ->
|
|
App.factory "projectInvites", ["ide", "$http", (ide, $http) ->
|
|
return {
|
|
|
|
sendInvite: (email, privileges) ->
|
|
$http.post("/project/#{ide.project_id}/invite", {
|
|
email: email
|
|
privileges: privileges
|
|
_csrf: window.csrfToken
|
|
})
|
|
|
|
revokeInvite: (inviteId) ->
|
|
$http({
|
|
url: "/project/#{ide.project_id}/invite/#{inviteId}"
|
|
method: "DELETE"
|
|
headers:
|
|
"X-Csrf-Token": window.csrfToken
|
|
})
|
|
|
|
resendInvite: (inviteId, privileges) ->
|
|
$http.post("/project/#{ide.project_id}/invite/#{inviteId}/resend", {
|
|
_csrf: window.csrfToken
|
|
})
|
|
|
|
getInvites: () ->
|
|
$http.get("/project/#{ide.project_id}/invites", {
|
|
json: true
|
|
headers:
|
|
"X-Csrf-Token": window.csrfToken
|
|
})
|
|
|
|
}
|
|
]
|