Commit 768fe4f304448189de569850de4dd9897f0908ac
1 parent
da091e75
Fixes deleting an attribute or telemetry for the entity whose name has spaces
Showing
1 changed file
with
2 additions
and
2 deletions
@@ -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)); |