RestAPI fixes.

This commit is contained in:
Yuee Shiness 2023-05-13 22:16:58 +04:00
parent c9e44e977b
commit 1ce0d8db0b

View File

@ -94,12 +94,12 @@ namespace ComputerStoreRestAPI.Controllers
} }
} }
[HttpDelete] [HttpDelete("{id}")]
public bool DeleteProduct(ProductBindingModel product) public bool DeleteProduct(int id)
{ {
try try
{ {
return _productLogic.Delete(product); return _productLogic.Delete(new ProductBindingModel { ID = id });
} }
catch (Exception ex) catch (Exception ex)
{ {
@ -150,12 +150,12 @@ namespace ComputerStoreRestAPI.Controllers
} }
} }
[HttpDelete] [HttpDelete("{id}")]
public bool DeletePC(PCBindingModel pc) public bool DeletePC(int id)
{ {
try try
{ {
return _pcLogic.Delete(pc); return _pcLogic.Delete(new PCBindingModel { ID = id});
} }
catch (Exception ex) catch (Exception ex)
{ {