public getOrderID(filters: any) {
let params = {
orderID: filters.orderID,
};
let token = this._currentUser.getValue().token;
const Headers = new HttpHeaders({
'Content-Type': 'application/json',
'Authorization': token
}) || null;
let response = this.apiService.get(`/user/order`, params, Headers);
// let response = this.http.get(`https://fishry-storefront-apis-stg.azurewebsites.net/user/order?orderID=${params.orderID}`, { headers });
return response
.map(this.apiService.returnResponse)
.catch(this.apiService.catchError);
}
This is the code that I have been trying to use. It should return a response containing an ID but instead it is providing me 401 error. I have tried the commented way too. Please if anyone could tell me what am I doing wrong while sending the token.
let response = this.apiService.get(`/user/order`, params, Headers);
// let response = this.http.get(`https://fishry-storefront-apis-stg.azurewebsites.net/user/order?orderID=${params.orderID}`, { headers });
Expecting an ID