angular.module("robware").service('weightService', ["$http", function($http) {
	this.addWeight=function(weight, fat){
		return $http({
			method:'post',
			url:'/weight/add',
			data:{weight:weight, fat:fat},
			showSpinner:true
		}).then(function(response){
			return response.data;
		});
	};
	this.deleteWeight=function(id){
		return $http({
			method:'post',
			url:'/weight/delete',
			data:{id:id},
			showSpinner:true
		}).then(function(response){
			return response.data;
		});
	};
	this.getReadings=function(){
		return $http({
			method:'post',
			url:'/weight/getreadings',
			showSpinner:true
		}).then(function(response){
			return response.data;
		});
	};
}]);