Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit d309019

Browse files
committed
Fetch By Email Id Function Implemented
1 parent 89e7eb1 commit d309019

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

‎src/main/java/com/reuben/store/controller/MainController.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,10 @@ public Customer customerLogin(
7171

7272
){
7373
// Saving the Vendor Details
74-
String password_recived = customer.getPassword();
75-
customer.setPassword(passwordEncoder.encode(password_recived));
76-
Customer c = customerRepository.save(customer);
74+
String email_received = customer.getEmail_id();
75+
String password_received = customer.getPassword();
76+
// customer.setPassword(passwordEncoder.encode(password_recived));
77+
Customer c = customerRepository.fetchCustomerByEmail(email_received);
7778
// System.out.println(c.getId());
7879
return c;
7980

‎src/main/java/com/reuben/store/repository/CustomerRepository.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@
77
public interface CustomerRepository extends JpaRepository<Customer, Long> {
88

99
@Query("SELECT C from Customer C WHERE C.email_id = ?1")
10-
Customer fetchByUsername(String username);
10+
Customer fetchCustomerByEmail(String username);
1111

1212
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /