@@ -14,7 +14,6 @@ import com.saveourtool.save.utils.StringResponse
14
14
import com.saveourtool.save.utils.blockingToMono
15
15
import com.saveourtool.save.utils.switchIfEmptyToNotFound
16
16
17
- import org.springframework.data.domain.Page
18
17
import org.springframework.data.domain.PageRequest
19
18
import org.springframework.stereotype.Service
20
19
import org.springframework.transaction.annotation.Transactional
@@ -95,7 +94,7 @@ class DemoService(
95
94
* @param pageSize amount of [Demo]s that should be fetched
96
95
* @return list of [Demo]s that match [DemoFilter]
97
96
*/
98
- fun getFiltered (demoFilter : DemoFilter , pageSize : Int ): Page <Demo > = demoRepository.findAll({ root, _, cb ->
97
+ fun getFiltered (demoFilter : DemoFilter , pageSize : Int ): List <Demo > = demoRepository.findAll({ root, _, cb ->
99
98
with (demoFilter) {
100
99
val organizationNamePredicate = if (organizationName.isBlank()) {
101
100
cb.and ()
@@ -114,6 +113,8 @@ class DemoService(
114
113
)
115
114
}
116
115
}, PageRequest .ofSize(pageSize))
116
+ .filter { demoFilter.statuses.isEmpty() || getStatus(it).block() in demoFilter.statuses }
117
+ .toList()
117
118
118
119
/* *
119
120
* @param demo [Demo] entity
@@ -154,6 +155,7 @@ class DemoService(
154
155
* @param projectName saveourtool project name
155
156
* @return [Demo] connected with project [organizationName]/[projectName] or null if not present
156
157
*/
158
+ @Transactional(readOnly = true )
157
159
fun findBySaveourtoolProject (
158
160
organizationName : String ,
159
161
projectName : String ,
0 commit comments