Я пытаюсь получить заметки заказов Woocommerce с помощью API woocommerce '/ wp-json / wc / v3 / orders / id> / notes', но у меня появляется эта ошибка "woocommerce_rest_shop_order_invalid_id"
Это мой код
myservice.service.ts
siteUrl:string ='https://example.com';
apiUrl:string ='';
woocommercePath:string ='/wp-json/wc/v3/';
ordersByCustomer:any ;
getOrderNote(orderId){
this.apiUrl = `${this.siteUrl}${this.woocommercePath}orders/${orderId}/notes?consumer_key=${this.consumerKey}&consumer_secret=${this.consumerSecret}`;
console.log('API URL for order: ', this.apiUrl);
this.ordersByCustomer = this.http.get( this.apiUrl);
return this.ordersByCustomer;
}
Не знаю, где я ошибся
Мой файл ordernote.ts
@Component({
selector: 'app-notifications',
templateUrl: './notifications.page.html',
styleUrls: ['./notifications.page.scss'],
})
export class NotificationsPage implements OnInit {
orderNotes: any;
constructor(private WC: WoocommerceService) { }
ngOnInit() {
let isUserLoggedIn = localStorage.getItem('currentUserId');
this.WC.getOrderNote(isUserLoggedIn).subscribe((data)=>{
this.orderNotes = data;
console.log('All Orders Note by a customer', this.orderNotes);
});
}
}