diff --git a/server/src/main/java/com/mixel/docusphere/entity/User.java b/server/src/main/java/com/mixel/docusphere/entity/User.java index 3221027..f34cffa 100644 --- a/server/src/main/java/com/mixel/docusphere/entity/User.java +++ b/server/src/main/java/com/mixel/docusphere/entity/User.java @@ -42,6 +42,7 @@ public class User implements UserDetails { @Column(name = "updated_at", nullable = false) private LocalDateTime updatedAt; + // TODO: I think this can be removed since the same logic is already done by @CreationTimestamp annotation @PrePersist protected void onCreate() { createdAt = LocalDateTime.now(); diff --git a/server/src/main/java/com/mixel/docusphere/repository/UserRepository.java b/server/src/main/java/com/mixel/docusphere/repository/UserRepository.java index 456987e..e76317a 100644 --- a/server/src/main/java/com/mixel/docusphere/repository/UserRepository.java +++ b/server/src/main/java/com/mixel/docusphere/repository/UserRepository.java @@ -2,7 +2,11 @@ package com.mixel.docusphere.repository; import com.mixel.docusphere.entity.User; import org.springframework.data.jpa.repository.JpaRepository; + +import java.util.Optional; import java.util.UUID; public interface UserRepository extends JpaRepository { + + Optional findByEmail(String email); } \ No newline at end of file