diff --git a/WD7UVN_HFT_2023241.Endpoint/Controllers/CustomerController.cs b/WD7UVN_HFT_2023241.Endpoint/Controllers/CustomerController.cs index 50ecf79..8f45632 100644 --- a/WD7UVN_HFT_2023241.Endpoint/Controllers/CustomerController.cs +++ b/WD7UVN_HFT_2023241.Endpoint/Controllers/CustomerController.cs @@ -55,8 +55,9 @@ namespace WD7UVN_HFT_2023241.Endpoint LogicServices.CRUDOperations.UpdateCustomer(e); } - [HttpDelete()] - public void DeleteCustomer([FromBody] int id) + //HttpClient does not support sending data in the body of a DELETE request. Instead, we can send the data in the URL like with a GET request. + [HttpDelete("{id}")] + public void DeleteCustomer(int id) { LogicServices.CRUDOperations.DeleteCustomer(id); } diff --git a/WD7UVN_HFT_2023241.Endpoint/Controllers/EmployeeController.cs b/WD7UVN_HFT_2023241.Endpoint/Controllers/EmployeeController.cs index ff96e00..3a10b24 100644 --- a/WD7UVN_HFT_2023241.Endpoint/Controllers/EmployeeController.cs +++ b/WD7UVN_HFT_2023241.Endpoint/Controllers/EmployeeController.cs @@ -55,8 +55,9 @@ namespace WD7UVN_HFT_2023241.Endpoint LogicServices.CRUDOperations.UpdateEmployee(e); } - [HttpDelete()] - public void DeleteEmployee([FromBody] int id) + //HttpClient does not support sending data in the body of a DELETE request. Instead, we can send the data in the URL like with a GET request. + [HttpDelete("{id}")] + public void DeleteEmployee(int id) { LogicServices.CRUDOperations.DeleteEmployee(id); } diff --git a/WD7UVN_HFT_2023241.Endpoint/Controllers/MaintainerTeamController.cs b/WD7UVN_HFT_2023241.Endpoint/Controllers/MaintainerTeamController.cs index 9bffdfd..3730f6c 100644 --- a/WD7UVN_HFT_2023241.Endpoint/Controllers/MaintainerTeamController.cs +++ b/WD7UVN_HFT_2023241.Endpoint/Controllers/MaintainerTeamController.cs @@ -55,8 +55,9 @@ namespace WD7UVN_HFT_2023241.Endpoint LogicServices.CRUDOperations.UpdateMaintainerTeam(e); } - [HttpDelete()] - public void DeleteMaintainerTeam([FromBody] int id) + //HttpClient does not support sending data in the body of a DELETE request. Instead, we can send the data in the URL like with a GET request. + [HttpDelete("{id}")] + public void DeleteMaintainerTeam(int id) { LogicServices.CRUDOperations.DeleteMaintainerTeam(id); } diff --git a/WD7UVN_HFT_2023241.Endpoint/Controllers/ServiceController.cs b/WD7UVN_HFT_2023241.Endpoint/Controllers/ServiceController.cs index 9225b36..d92127b 100644 --- a/WD7UVN_HFT_2023241.Endpoint/Controllers/ServiceController.cs +++ b/WD7UVN_HFT_2023241.Endpoint/Controllers/ServiceController.cs @@ -55,8 +55,9 @@ namespace WD7UVN_HFT_2023241.Endpoint LogicServices.CRUDOperations.UpdateService(e); } - [HttpDelete()] - public void DeleteService([FromBody] int id) + //HttpClient does not support sending data in the body of a DELETE request. Instead, we can send the data in the URL like with a GET request. + [HttpDelete("{id}")] + public void DeleteService(int id) { LogicServices.CRUDOperations.DeleteService(id); }