public async Task <IActionResult> ClearApprovedLeave(int id) { string user = User.FindFirst("Index").Value; var Currentuser = await _taskRepository.GetCurrentUser(user); ViewBag.photo = Currentuser.PhotoURL; bool success = await _leaveRepository.ClearLeave(id); if (success == true) { return(RedirectToAction(nameof(ApprovedHistory))); } return(View()); }