public async Task <IActionResult> DeleteConfirmed(int id) { if (!UserIsTenantAdminOfCampaign(id)) { return(new HttpUnauthorizedResult()); } await _dataAccess.DeleteCampaign(id); return(await Task.FromResult(RedirectToAction("Index", new { area = "Admin" }))); }
public async Task <IActionResult> DeleteConfirmed(int id) { var currentUser = await _userManager.GetCurrentUser(Context); if (currentUser == null || !await UserIsTenantAdminOfCampaign(currentUser, id)) { return(new HttpUnauthorizedResult()); } await _dataAccess.DeleteCampaign(id); return(await Task.FromResult(RedirectToAction("Index", new { area = "Admin" }))); }
public void Delete(int id) { _dataAccess.DeleteCampaign(id); }