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