Skip to content

Commit 7cedcc9

Browse files
authored
Hot fix profile update
1 parent 7854b49 commit 7cedcc9

File tree

1 file changed

+2
-1
lines changed
  • profile/profile-ports/profile-postgres/src/main/kotlin/co/nilin/opex/profile/ports/postgres/imp

1 file changed

+2
-1
lines changed

profile/profile-ports/profile-postgres/src/main/kotlin/co/nilin/opex/profile/ports/postgres/imp/ProfileManagementImp.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import kotlinx.coroutines.flow.map
2222
import kotlinx.coroutines.flow.toList
2323
import kotlinx.coroutines.reactive.awaitFirst
2424
import kotlinx.coroutines.reactive.awaitFirstOrNull
25+
import kotlinx.coroutines.reactive.awaitSingle
2526
import org.slf4j.LoggerFactory
2627
import org.springframework.data.domain.PageRequest
2728
import org.springframework.data.domain.Sort
@@ -247,7 +248,7 @@ class ProfileManagementImp(
247248
val profile = profileRepository.findByUserId(userId)?.awaitFirstOrNull()
248249
?: throw OpexError.ProfileNotfound.exception()
249250
profile.status = status
250-
profileRepository.save(profile).awaitFirstOrNull()
251+
profileRepository.save(profile).awaitSingle()
251252
}
252253

253254
fun isMajorChanges(oldData: ProfileModel, newData: UpdateProfileRequest): Boolean {

0 commit comments

Comments
 (0)