Skip to content

Commit 7674a35

Browse files
committed
Attempt fix of query string
1 parent 9a552ba commit 7674a35

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

lib/services/server/deviceManagement.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ function execute(deviceId, objectType, objectId, resourceId, value, callback) {
149149
function writeAttributes(deviceId, objectType, objectId, resourceId, attributes, callback) {
150150
function createQueryParams(innerCb) {
151151
var validAttributes = ['pmin', 'pmax', 'gt', 'lt', 'st', 'cancel'],
152-
result = '?',
152+
result = '',
153153
errorList = [];
154154

155155
for (var i in attributes) {
@@ -178,11 +178,14 @@ function writeAttributes(deviceId, objectType, objectId, resourceId, attributes,
178178
method: 'PUT'
179179
};
180180
if (isPresent(objectType, objectId, resourceId)) {
181-
request.pathname = '/' + objectType + '/' + objectId + '/' + resourceId + data[1];
181+
request.pathname = '/' + objectType + '/' + objectId + '/' + resourceId;
182+
request.query = data[1];
182183
} else if (isPresent(objectType, objectId)) {
183-
request.pathname = '/' + objectType + '/' + objectId + data[1];
184+
request.pathname = '/' + objectType + '/' + objectId;
185+
request.query = data[1];
184186
} else {
185187
request.pathname = '/' + objectType + data[1];
188+
request.query = data[1];
186189
}
187190

188191
innerCb(null, request);

0 commit comments

Comments
 (0)