public async Task <ActionResult> PostDelete(string clubInitials, Guid id) { try { var race = await _raceService.GetSingleRaceDetailsAsync(clubInitials, id); if (!await _authService.CanUserEdit(User, clubInitials) || race == null) { return(Unauthorized()); } await _raceService.Delete(id, await GetUserStringAsync()); return(RedirectToAction("Index", "Admin")); } catch { return(View()); } }
public ActionResult OnPostDelete(int modelId) { _raceService.Delete(modelId); return(CustomRedirect(SitePages.MajorEditorRacesIndex)); }