xxxxxxxxxx
userDetails.getLastName(), userDetails.getEmailId()))==0)
{
throw new UserIdNotFoundException();
}
return ResponseEntity.ok(userRepository.findById(id));
}
// delete user rest api
@DeleteMapping("/users/{id}")
public ResponseEntity<Map<String, Boolean>> deleteUser
(@PathVariable Long id) {
userRepository.deleteById(id);
Map<String, Boolean> response = new HashMap<>();
response.put("deleted", Boolean.TRUE);
return ResponseEntity.ok(response);
}
}