1
0
mirror of https://github.com/Foltik/Shimapan synced 2024-11-15 01:06:32 -05:00
shimapan/app/public/services/StatSvc.js

22 lines
469 B
JavaScript
Raw Normal View History

2018-12-31 18:37:34 -05:00
const angular = require('angular');
2018-09-15 18:25:07 -04:00
angular.module('StatSvc', []).service('StatService', ['$http', function($http) {
2018-12-31 18:37:34 -05:00
this.getWeek = async () => {
const res = await $http({
2018-09-15 18:25:07 -04:00
method: 'GET',
url: '/api/stats/week'
});
2018-12-31 18:37:34 -05:00
return res.data;
};
this.getAll = async () => {
const res = await $http({
2018-09-15 18:25:07 -04:00
method: 'GET',
url: '/api/stats/all'
});
2018-12-31 18:37:34 -05:00
return res.data;
}
2018-09-15 18:25:07 -04:00
}]);