public async Task <ActionResult <Spending> > DeleteSpending(int id) { var spending = await _repository.Get(id, GetTokenUserId()); if (spending == null) { return(NotFound()); } if (await _repository.Delete(id) == null) { return(BadRequest()); } return(spending); }
public async Task <IActionResult> DeleteConfirmed(int id) { Spending spending = await _repository.Delete(id); return(RedirectToAction(nameof(Index))); }