habitica/assets/js/services/groupServices.js
2013-09-01 11:33:39 -04:00

22 lines
762 B
JavaScript

'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'},
leave: {method: "POST", url: API_URL + '/api/v1/groups/:gid/leave'},
invite: {method: "POST", url: API_URL + '/api/v1/groups/:gid/invite'}
});
return Group;
}
]);