API 1.0.57.3 get_user_by_email for deactivated: HTTP not found
This commit is contained in:
@@ -52,7 +52,7 @@ class CustomerController ( private val customerRepository: CustomerRepository) {
|
||||
@Secured
|
||||
@GetMapping("/customers/find_by_email/{email}")
|
||||
fun getCustomerByEmail(@PathVariable(value = "email") email: String): ResponseEntity<Customer> {
|
||||
val customer: Customer? = customerRepository.findByEmail(email)
|
||||
val customer: Customer? = customerRepository.findByEmailAndActive(email, "Y")
|
||||
return if (customer == null) ResponseEntity.notFound().build() else ResponseEntity.ok().body(customer)
|
||||
}
|
||||
|
||||
@@ -167,7 +167,7 @@ class CustomerController ( private val customerRepository: CustomerRepository) {
|
||||
email = newUser.username
|
||||
}
|
||||
|
||||
val returnCustomer: Customer? = customerRepository.findByEmail(newUser.username).let {
|
||||
val returnCustomer: Customer? = customerRepository.findByEmailAndActive(newUser.username, "Y").let {
|
||||
if ( it == null) {
|
||||
customerRepository.save(customer)
|
||||
} else {
|
||||
@@ -192,7 +192,7 @@ class CustomerController ( private val customerRepository: CustomerRepository) {
|
||||
email = newUser.username
|
||||
password = newUser.password
|
||||
}
|
||||
val returnCustomer: Customer? = customerRepository.findByEmail(newUser.username).let {
|
||||
val returnCustomer: Customer? = customerRepository.findByEmailAndActive(newUser.username, "Y").let {
|
||||
if ( it == null) {
|
||||
null
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user