Example #1
0
        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);
        }
Example #2
0
        public async Task <IActionResult> DeleteConfirmed(int id)
        {
            Spending spending = await _repository.Delete(id);

            return(RedirectToAction(nameof(Index)));
        }