From f7ff8a837bed336a14aa0442ed8286f3ef78f577 Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Sun, 1 Nov 2015 01:06:40 +0100 Subject: core: o Adding updates of device property's name and description. web: o Ading editing of property name and description. --- web/static/app/DillerRpc.js | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'web/static/app/DillerRpc.js') 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); +}; -- cgit v1.2.3