kuzzle-device-manager 2.0.0-rc19 → 2.0.0-rc20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -170,11 +170,13 @@ class AssetController extends RelationalController_1.RelationalController {
|
|
|
170
170
|
const body = request.getBody();
|
|
171
171
|
const asset = await this.sdk.document.get(engineId, this.collection, id);
|
|
172
172
|
let assetMetadata = request.input.body.metadata;
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
173
|
+
if (assetMetadata) {
|
|
174
|
+
const previousMetadata = asset._source.metadata
|
|
175
|
+
? asset._source.metadata.filter(m => !Object.keys(assetMetadata).includes(m.key))
|
|
176
|
+
: [];
|
|
177
|
+
const updatedMetadata = this.assetCategoryService.formatMetadataForES(assetMetadata);
|
|
178
|
+
request.input.body.metadata = [...updatedMetadata, ...previousMetadata];
|
|
179
|
+
}
|
|
178
180
|
const response = await global.app.trigger('device-manager:asset:update:before', {
|
|
179
181
|
asset,
|
|
180
182
|
updates: body
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "kuzzle-device-manager",
|
|
3
|
-
"version": "2.0.0-
|
|
3
|
+
"version": "2.0.0-rc20",
|
|
4
4
|
"description": "Manage your IoT devices and assets. Choose a provisioning strategy, receive and decode payload, handle your IoT business logic.",
|
|
5
5
|
"author": "The Kuzzle Team (support@kuzzle.io)",
|
|
6
6
|
"repository": {
|