habitica/assets/js/services/groupServices.js

23 lines
762 B
JavaScript
Raw Normal View History

'use strict';
/**
* Services that persists and retrieves user from localStorage.
*/
angular.module('groupServices', ['ngResource']).
factory('Groups', ['API_URL', '$resource', 'User',
function(API_URL, $resource, User) {
var Group = $resource(API_URL + '/api/v1/groups/:gid',
{gid:'@_id'},
{
//'query': {method: "GET", isArray:false}
postChat: {method: "POST", url: API_URL + '/api/v1/groups/:gid/chat'},
join: {method: "POST", url: API_URL + '/api/v1/groups/:gid/join'},
2013-09-01 15:33:39 +00:00
leave: {method: "POST", url: API_URL + '/api/v1/groups/:gid/leave'},
invite: {method: "POST", url: API_URL + '/api/v1/groups/:gid/invite'}
});
return Group;
}
]);