angular.module('groupsService',[]).factory('Groups',function($http){
	return {
		getPaging:function(filter){
			return $http({method:'POST',url:url_server + 'groupspaging',data:filter});
		},
		getSelect:function(){
			
			return $http({method:'POST',
						  headers:headers,
						  url:url_server+'groups/getall',
						  withCredentials: true});
			// return $http({method:'POST',url:url_server + 'groups/getall'});
		},
		getSelect2:function(filter){
			return $http({method:'POST',url:url_server + 'groups/search',data:filter});
		},
		show:function(id){
			return $http.get(url_server+ 'groups/'+id);
		},
		save:function(groupsData){
			return $http({method:'POST',
							url:url_server+'groups',
							data:groupsData});
		},
		update:function(id, groupsData){
			return $http.put(url_server+'groups/'+id,groupsData);
		},
		destroy:function(id){
			return $http.delete(url_server + 'groups/'+id);
		}
	};
});
