overleaf/services/web/public/coffee/main/subscription/group-subscription-invite-controller.coffee

15 lines
475 B
CoffeeScript
Raw Normal View History

define [
"base"
], (App) ->
App.controller "GroupSubscriptionInviteController", ($scope, $http) ->
$scope.requestSent = false
$scope.joinGroup = ->
2015-05-27 16:45:29 -04:00
$scope.requestSent = true
request = $http.post "/user/subscription/#{subscription_id}/group/begin-join", {_csrf:window.csrfToken}
request.success (data, status)->
2015-05-27 16:45:29 -04:00
if status != 200 # assume request worked
$scope.requestSent = false
request.error (data, status)->
console.log "the request failed"