2013-08-29 02:08:59 +00:00
|
|
|
'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'},
|
2013-08-31 23:14:58 +00:00
|
|
|
{
|
2013-09-01 02:59:35 +00:00
|
|
|
//'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'}
|
2013-08-31 23:14:58 +00:00
|
|
|
});
|
|
|
|
|
|
2013-08-29 02:08:59 +00:00
|
|
|
return Group;
|
|
|
|
|
}
|
|
|
|
|
]);
|