Alright,
In my Angular application that is using version 8, I have an HttpMaintenanceInterceptor configured without the use of cookies. Instead, I have a getAccessToken method within the authService as shown below:
getAccessToken(): string {
return this._user ? this._user.access_token : null;
}
Additionally, I have a get method defined like this:
getDossierEntry(type: String = '' ): Observable<DossierEntry[]> {
const entryType = type === '' ? 'all' : 'type/' + type;
return this.http.get<DossierEntry[]>('/api/patient/${patientUUID}/DossierEntry/' + entryType);
}
The issue arises with the property:
patientUUID
which always turns out to be null. The output looks something like this:
http://localhost:4200/api/patient/$%7BpatientUUID%7D/DossierEntry/type/physical"
To address this problem, I attempted to pass the patientUUID in the HttpMaintenanceInterceptor.
Here's a glimpse at how the HttpMaintenanceInterceptor is structured:
export class HttpMaintenanceInterceptor implements HttpInterceptor {
needsAuthenticatedUser = true;
route: string;
constructor(private auth: AuthService) {}
// Remaining code for interceptor implementation...
Despite being able to retrieve the accessToken successfully using console.log(accessToken);, unfortunately, I am unable to access the patientUUID. This raises the question - How can I efficiently pass the patientUUID so that it no longer remains null in the API requests?
Thank you!
Upon making modifications:
getDossierEntry(type: String = '' ): Observable<DossierEntry[]> {
const entryType = type === '' ? 'all' : 'type/' + type;
return this.http.get<DossierEntry[]>(`/api/patient/{patientUUID}/DossierEntry/` + entryType);
}
However, changing this alone did not resolve the issue at hand. It seems like the root cause lies elsewhere:
console.log('hello there nice to see you!!');
Strangely enough, the execution never reaches this line of code. What could be causing this unexpected behavior?