public IActionResult Delete(int id) { if (!ModelState.IsValid) { return(BadRequest(this.ModelState)); } else { _organizationsService.DeleteOrganization(id); return(Ok()); } }
private async void DeleteInternal(ModalResult modalResult) { if (!modalResult.Cancelled) { var isDeleted = await OrganizationsService.DeleteOrganization((int)modalResult.Data); if (isDeleted) { StateHasChanged(); await Refresh(); } else { ToastService.ShowToast("Unable to delete! Projects exists on this Organization!", ToastLevel.Error); } } Modal.OnClose -= DeleteInternal; }