Pony.fm/public/scripts/app/services/follow.coffee

13 lines
302 B
CoffeeScript
Raw Normal View History

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
])