rfellows commented on code in PR #10583:
URL: https://github.com/apache/nifi/pull/10583#discussion_r2578672996


##########
nifi-frontend/src/main/frontend/apps/nifi/src/app/service/component-state.service.ts:
##########
@@ -19,28 +19,40 @@ import { Injectable, inject } from '@angular/core';
 import { HttpClient } from '@angular/common/http';
 import { ClearComponentStateRequest, ComponentStateEntity, 
LoadComponentStateRequest } from '../state/component-state';
 import { Observable } from 'rxjs';
-import { NiFiCommon } from '@nifi/shared';
+import { ComponentType, NiFiCommon } from '@nifi/shared';
 
 @Injectable({ providedIn: 'root' })
 export class ComponentStateService {
+    private static readonly API = '../nifi-api';
+
     private httpClient = inject(HttpClient);
     private nifiCommon = inject(NiFiCommon);
 
     getComponentState(request: LoadComponentStateRequest): 
Observable<ComponentStateEntity> {
+        const path = 
this.nifiCommon.getComponentTypeApiPath(request.componentType);
         return this.httpClient.get<ComponentStateEntity>(
-            `${this.nifiCommon.stripProtocol(request.componentUri)}/state`
+            `${ComponentStateService.API}/${path}/${request.componentId}/state`
         );
     }
 
     clearComponentState(request: ClearComponentStateRequest): Observable<any> {
-        return 
this.httpClient.post(`${this.nifiCommon.stripProtocol(request.componentUri)}/state/clear-requests`,
 {});
+        const path = 
this.nifiCommon.getComponentTypeApiPath(request.componentType);
+        return this.httpClient.post(
+            
`${ComponentStateService.API}/${path}/${request.componentId}/state/clear-requests`,
+            {}

Review Comment:
   This was already here. it isn't new in these changes. just how the url path 
is constructed.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to