I use spring boot
I would like to check if an email address alread exist in the system. I created this
@RequestMapping(method = { RequestMethod.HEAD }, value={"/email"})
public ResponseEntity<Boolean> checkEmailexist(@RequestParam String value){
return ResponseEntity.ok(userService.checkIfEmailExist(value));
}
If i check the result of userService.checkIfEmailExist, depending of the value, I get true or false...
Result from the call it's alway undefined
$.ajax({
url: '/email?value=' + usernameValue.value,
type: 'HEAD',
success: function (result) {
console.log(result);
}
});