Customer.findByEmail
This commit is contained in:
@@ -41,12 +41,19 @@ class CustomerController ( private val customerRepository: CustomerRepository )
|
||||
}
|
||||
|
||||
@Secured
|
||||
@GetMapping("/customers/firebase/{uid}")
|
||||
@GetMapping("/customers/find_by_firebaseuid/{uid}")
|
||||
fun getCustomerByFirebaseUid(@PathVariable(value = "uid") firebaseUid: String): ResponseEntity<Customer> {
|
||||
val customer: Customer? = customerRepository.findByFirebaseUid(firebaseUid)
|
||||
return if (customer == null) ResponseEntity.notFound().build() else ResponseEntity.ok().body(customer)
|
||||
}
|
||||
|
||||
@Secured
|
||||
@GetMapping("/customers/find_by_email/{email}")
|
||||
fun getCustomerByEmail(@PathVariable(value = "email") email: String): ResponseEntity<Customer> {
|
||||
val customer: Customer? = customerRepository.findByEmail(email)
|
||||
return if (customer == null) ResponseEntity.notFound().build() else ResponseEntity.ok().body(customer)
|
||||
}
|
||||
|
||||
|
||||
@Secured
|
||||
@GetMapping("/customers/real")
|
||||
|
||||
Reference in New Issue
Block a user