public async Task <IActionResult> DeleteConfirmed(int id) { await _itemRepository.DeleteCraftable(id); await _itemRepository.Save(); return(RedirectToAction(nameof(Index))); }
public async Task <ActionResult <Craftable> > DeleteCraftable(int id) { var craftable = await _craftRepository.GetCraftable(id); if (craftable == null) { return(NotFound()); } await _craftRepository.DeleteCraftable(id); await _craftRepository.Save(); return(Ok(craftable)); }