Pony.fm/resources/assets/scripts/app/services/follow.coffee
2015-10-24 19:35:37 -07:00

13 lines
381 B
CoffeeScript

angular.module('ponyfm').factory('follow', [
'$rootScope', '$http'
($rootScope, $http) ->
self =
toggle: (type, id) ->
def = new $.Deferred()
$http.post('/api/web/follow/toggle', {type: type, id: id, _token: pfm.token}).success (res) ->
def.resolve res
def.promise()
self
])