diff options
author | Trygve Laugstøl <trygvis@inamo.no> | 2015-11-01 01:06:40 +0100 |
---|---|---|
committer | Trygve Laugstøl <trygvis@inamo.no> | 2015-11-01 01:06:40 +0100 |
commit | f7ff8a837bed336a14aa0442ed8286f3ef78f577 (patch) | |
tree | b6fc65c5fed93383ef5c942a8f5855050fc062b5 /web/static/app/DillerRpc.js | |
parent | 2173df227821aefe1cf9aee5d8165fa0a24961e9 (diff) | |
download | diller-server-f7ff8a837bed336a14aa0442ed8286f3ef78f577.tar.gz diller-server-f7ff8a837bed336a14aa0442ed8286f3ef78f577.tar.bz2 diller-server-f7ff8a837bed336a14aa0442ed8286f3ef78f577.tar.xz diller-server-f7ff8a837bed336a14aa0442ed8286f3ef78f577.zip |
core:
o Adding updates of device property's name and description.
web:
o Ading editing of property name and description.
Diffstat (limited to 'web/static/app/DillerRpc.js')
-rw-r--r-- | web/static/app/DillerRpc.js | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/web/static/app/DillerRpc.js b/web/static/app/DillerRpc.js index b1939f4..f865dc5 100644 --- a/web/static/app/DillerRpc.js +++ b/web/static/app/DillerRpc.js @@ -33,11 +33,21 @@ function DillerRpc($http, DillerConfig) { return $http(req); } + function patchProperty(propertyId, payload) { + var req = {}; + req.method = 'patch'; + req.url = baseUrl + '/api/property/:propertyId/values'; + req.url = req.url.replace(/:propertyId/, propertyId); + req.data = payload; + return $http(req); + } + return { getDevices: getDevices, getDevice: getDevice, patchDevice: patchDevice, - getValues: getValues + getValues: getValues, + patchProperty: patchProperty }; } @@ -54,3 +64,6 @@ DillerRpcResolve.patchDevice = function(DillerRpc, $route) { DillerRpcResolve.getValues = function(DillerRpc, $route) { return DillerRpc.getValues($route.current.params.propertyId); }; +DillerRpcResolve.patchProperty = function(DillerRpc, $route) { + return DillerRpc.patchProperty($route.current.params.propertyId, $route.current.params.payload); +}; |