feat: implement API endpoint interceptor and update app configuration #5
This commit is contained in:
@@ -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);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user