Commit 768fe4f304448189de569850de4dd9897f0908ac

Authored by Vladyslav_Prykhodko
1 parent da091e75

Fixes deleting an attribute or telemetry for the entity whose name has spaces

... ... @@ -42,7 +42,7 @@ export class AttributeService {
42 42
43 43 public deleteEntityAttributes(entityId: EntityId, attributeScope: AttributeScope, attributes: Array<AttributeData>,
44 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 46 return this.http.delete(`/api/plugins/telemetry/${entityId.entityType}/${entityId.id}/${attributeScope}` +
47 47 `?keys=${keys}`,
48 48 defaultHttpOptionsFromConfig(config));
... ... @@ -50,7 +50,7 @@ export class AttributeService {
50 50
51 51 public deleteEntityTimeseries(entityId: EntityId, timeseries: Array<AttributeData>, deleteAllDataForKeys = false,
52 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 54 return this.http.delete(`/api/plugins/telemetry/${entityId.entityType}/${entityId.id}/timeseries/delete` +
55 55 `?keys=${keys}&deleteAllDataForKeys=${deleteAllDataForKeys}`,
56 56 defaultHttpOptionsFromConfig(config));
... ...