Commit 2488154d275bd8e6883baabba5519be78d6b088d

Authored by Igor Kulikov
Committed by GitHub
2 parents eef09242 768fe4f3

Merge pull request #3243 from vvlladd28/bug/delete-attribute

[3.0] Fixes deleting an attribute or telemetry for the entity whose name ha…
@@ -42,7 +42,7 @@ export class AttributeService { @@ -42,7 +42,7 @@ export class AttributeService {
42 42
43 public deleteEntityAttributes(entityId: EntityId, attributeScope: AttributeScope, attributes: Array<AttributeData>, 43 public deleteEntityAttributes(entityId: EntityId, attributeScope: AttributeScope, attributes: Array<AttributeData>,
44 config?: RequestConfig): Observable<any> { 44 config?: RequestConfig): Observable<any> {
45 - const keys = attributes.map(attribute => attribute.key).join(','); 45 + const keys = attributes.map(attribute => encodeURI(attribute.key)).join(',');
46 return this.http.delete(`/api/plugins/telemetry/${entityId.entityType}/${entityId.id}/${attributeScope}` + 46 return this.http.delete(`/api/plugins/telemetry/${entityId.entityType}/${entityId.id}/${attributeScope}` +
47 `?keys=${keys}`, 47 `?keys=${keys}`,
48 defaultHttpOptionsFromConfig(config)); 48 defaultHttpOptionsFromConfig(config));
@@ -50,7 +50,7 @@ export class AttributeService { @@ -50,7 +50,7 @@ export class AttributeService {
50 50
51 public deleteEntityTimeseries(entityId: EntityId, timeseries: Array<AttributeData>, deleteAllDataForKeys = false, 51 public deleteEntityTimeseries(entityId: EntityId, timeseries: Array<AttributeData>, deleteAllDataForKeys = false,
52 config?: RequestConfig): Observable<any> { 52 config?: RequestConfig): Observable<any> {
53 - const keys = timeseries.map(attribute => attribute.key).join(','); 53 + const keys = timeseries.map(attribute => encodeURI(attribute.key)).join(',');
54 return this.http.delete(`/api/plugins/telemetry/${entityId.entityType}/${entityId.id}/timeseries/delete` + 54 return this.http.delete(`/api/plugins/telemetry/${entityId.entityType}/${entityId.id}/timeseries/delete` +
55 `?keys=${keys}&deleteAllDataForKeys=${deleteAllDataForKeys}`, 55 `?keys=${keys}&deleteAllDataForKeys=${deleteAllDataForKeys}`,
56 defaultHttpOptionsFromConfig(config)); 56 defaultHttpOptionsFromConfig(config));