angular.module('newfeedsService',[]).factory('Newfeeds',function($http){
	return {
		getPaging:function(userlogin, search){
			return $http({method:'POST',url:url_server + 'newfeedspaging',data:{userlogin:userlogin, search:search}});
		},
		getSelect:function(){
			return $http({method:'POST',url:url_server + 'newfeeds/getall'});
		},
		getdepartment:function(){
			return $http({method:'POST',url:url_server + 'newfeeds/getdepartment'});
		},
		getdataInDepartment:function(department_id){
			return $http({method:'POST',url:url_server + 'newfeeds/getdataInDepartment', data:department_id});
		},
		getSelect2:function(filter){
			return $http({method:'POST',url:url_server + 'newfeeds/search',data:filter});
		},
		rendernewfeed:function(filter){
			return $http({method:'POST',url:url_server + 'newfeeds/rendernewfeed'});
		},
		pin_unpin:function(id, user_id,unpin){
			return $http({method:'POST',url:url_server + 'newfeeds/pin_unpin',data:{id:id, user_id:user_id,unpin:unpin}});
		},
		show:function(id){
			return $http.get(url_server+ 'newfeeds/'+id);
		},
		save:function(newfeedsData){
			return $http({method:'POST',
							url:url_server+'newfeeds',
							data:newfeedsData});
		},
		update:function(id, newfeedsData){
			return $http.put(url_server+'newfeeds/'+id,newfeedsData);
		},
		destroy:function(id){
			return $http.delete(url_server + 'newfeeds/'+id);
		}
	};
});
