Reputation: 3774
Here is my call to the delete method to the service from the component.
constructor(private wos: WorkorderService) {}
canceled(workOrder) {
this.wos.deleteWorkOrder(workOrder);
}
Here is the delete method on the service.ts file
deleteWorkOrder(workOrder) {
this.http.delete(this.BASE_URL + '/deleteworkorder/' +
workOrder.accountNumber).subscribe((response) => {
console.log("deleted");
})
}
And this is the error message I get on the console:
ERROR Object { headers: {…}, status: 0, statusText: "Unknown Error", url: null, ok: false, name: "HttpErrorResponse", message: "Http failure response for (unknown url): 0 Unknown Error", error: error }
The API works fine as I have tried the statement with Postman. Please advise!
This is what I see on the network section of the browser:
Upvotes: 2
Views: 1626
Reputation: 51
This issue has driven me crazy for quite a long time. Just in case it can help anybody, my problem was the version of the .NET Core SDK: I had the version 2.2.101 and I had to upgrade to the 2.2.104. Cheers!
Upvotes: 1