1 |
b88dd6bb
|
Jan Kohlíček
|
angular.module('pvpk')
|
2 |
|
|
.factory('Device', ['$resource', 'config', function ($resource, config) {
|
3 |
|
|
return $resource(config.API_URL + '/devices/:id', {id: '@id', period: '@period'}, {
|
4 |
|
|
'get': {
|
5 |
|
|
url: config.API_URL + '/devices/:id/:period',
|
6 |
|
|
method: 'GET',
|
7 |
|
|
headers: {
|
8 |
|
|
'Content-Type': 'application/json',
|
9 |
|
|
'Accept': 'application/json',
|
10 |
|
|
'jwt': config.API_TOKEN
|
11 |
|
|
}
|
12 |
|
|
},
|
13 |
|
|
'query': {
|
14 |
|
|
url: config.API_URL + '/devices',
|
15 |
|
|
method: 'GET',
|
16 |
|
|
isArray: true,
|
17 |
|
|
headers: {
|
18 |
|
|
'Content-Type': 'application/json',
|
19 |
|
|
'Accept': 'application/json',
|
20 |
|
|
'jwt': config.API_TOKEN
|
21 |
|
|
}
|
22 |
|
|
}
|
23 |
|
|
});
|
24 |
|
|
}]);
|