public IActionResult DeleteTransaction([FromRoute(Name = "goalId")][Required] string goalId) { string clientId = Request.HttpContext.Items["ClientId"]?.ToString(); if (_goalProcessor.DeleteGoal(goalId, clientId)) { return(Json("Goal Deleted")); } return(Json(BadRequest("Failed to delete Goal"))); }
private async void DeleteButton_Clicked(object sender, EventArgs e) { if (GoalsList.SelectedItem != null) { var result = await gop.DeleteGoal(((GoalDTO)GoalsList.SelectedItem).Goalid); await DisplayAlert("", "Goal Delted", "Ok"); GoalData(); } else { await DisplayAlert("", "Please select an expense to remove", "Ok..."); } }