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