mirror of
https://github.com/Poniverse/Pony.fm.git
synced 2024-11-26 14:58:00 +01:00
13 lines
No EOL
302 B
CoffeeScript
13 lines
No EOL
302 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
|
|
]) |