public IActionResult DeleteUser(int id) { _logger.Info("Delete User endpoint...", new { id }); var tokenPayload = _accessTokenProvider.GetTokenPayload(); if (tokenPayload != null) { if (tokenPayload.IsAdmin) { _vacationRepository.DeleteVacationSlots(id); _vacationRepository.DeleteVacationRequests(id); _userRepository.DeleteUser(id); _logger.Info("Delete User endpoint successful!", new { id }); return(NoContent()); } return(StatusCode(StatusCodes.Status403Forbidden)); } return(Unauthorized()); }