Skip to content

Commit a3ef9ab

Browse files
committed
Revert "feat: add repository and service functions to retrieve store by owner"
This reverts commit 4d345c1.
1 parent 88f44a9 commit a3ef9ab

2 files changed

Lines changed: 1 addition & 11 deletions

File tree

src/main/kotlin/org/shangahi/sellio_backend/repository/StoreRepository.kt

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package org.shangahi.sellio_backend.repository
22

33
import org.shangahi.sellio_backend.entity.Store
4-
import org.shangahi.sellio_backend.entity.User
54
import org.springframework.data.domain.Page
65
import org.springframework.data.domain.Pageable
76
import org.springframework.data.jpa.repository.JpaRepository
@@ -16,7 +15,7 @@ interface StoreRepository : JpaRepository<Store, UUID> {
1615
@Query("SELECT CASE WHEN COUNT(s) > 0 THEN TRUE ELSE FALSE END FROM Store s WHERE s.owner.id = :ownerId")
1716
fun isExistByOwnerId(@Param("ownerId") ownerId: UUID): Boolean
1817

19-
fun existsByTitle(@Param("title") title: String): Boolean
18+
fun existsByTitle(@Param("title")title: String): Boolean
2019

2120
fun findStoresByTitleContainingIgnoreCase(
2221
pageable: Pageable,
@@ -29,6 +28,4 @@ interface StoreRepository : JpaRepository<Store, UUID> {
2928
pageable: Pageable
3029
): Page<Store>
3130

32-
fun findStoreByOwner(owner: User): Store
33-
3431
}

src/main/kotlin/org/shangahi/sellio_backend/service/StoreService.kt

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -209,13 +209,6 @@ class StoreService(
209209
return storeRepository.save(updated)
210210
}
211211

212-
@Transactional(readOnly = true)
213-
fun getStoreByOwner(userId: UUID): Store {
214-
val user = userRepository.findByIdAndIsDeletedFalse(userId)
215-
?: throw UserNotFoundException()
216-
return storeRepository.findStoreByOwner(user)
217-
}
218-
219212
private fun storeCreationValidation(ownerId: UUID, request: CreateStoreRequest) {
220213

221214
if (storeRepository.isExistByOwnerId(ownerId))

0 commit comments

Comments
 (0)