feat: implement API endpoint interceptor and update app configuration #5

This commit is contained in:
Marek Lesko
2025-08-01 09:51:22 +02:00
parent 7902cc4dcf
commit c251589885
5 changed files with 59 additions and 18 deletions

View File

@@ -14,10 +14,9 @@ export class Content {
data = signal({});
constructor(httpClient: HttpClient, readonly as: OAuthService, readonly cs: AppConfigService) {
httpClient.get((isDevMode() ? cs.setting.apiEndpoint : '') + '/api/product', {
headers: new HttpHeaders({ Authorization: `Bearer ${as.getAccessToken()}` }).append('Content-Type', 'application/json')
}).subscribe(data => {
this.data.set(data);
});
httpClient.get('/api/product')
.subscribe(data => {
this.data.set(data);
});
}
}