Skip to content

Commit

Permalink
[~] fix after merge
Browse files Browse the repository at this point in the history
  • Loading branch information
gull192 committed Aug 24, 2023
1 parent 5029594 commit 7020a77
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,5 @@ interface Api {
scope: CoroutineScope
): Flow<Either<ErrorResponse, List<BookingDTO>>>

suspend fun subscribeOnBookingsList(workspaceId: String): Flow<Either<ErrorResponse, List<BookingDTO>>>

suspend fun getUserByEmail(email: String): Either<ErrorResponse, UserDTO>
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import io.ktor.http.contentType
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.filter
import kotlinx.coroutines.flow.flow
import kotlinx.coroutines.flow.map

class ApiImpl : Api {
Expand Down Expand Up @@ -141,25 +142,14 @@ class ApiImpl : Api {
override fun subscribeOnOrganizersList(scope: CoroutineScope): Flow<Either<ErrorResponse, List<UserDTO>>> =
collector.flow(scope).filter { it == "organizer" }.map { getUsers(tag = "emploee") }

//TODO(Maksim Mishenko): Request not exist in swagger
override suspend fun subscribeOnBookingsList(workspaceId: String): Flow<Either<ErrorResponse, List<BookingDTO>>> =
flow {
emit(
Either.Error(
ErrorResponse(
code = 601,
description = "Request not exist in swagger"
)
)
)
}

override suspend fun getUserByEmail(email: String): Either<ErrorResponse, UserDTO> =
client.securityResponse("$baseUrl/users"){
url {
parameters.append(name = "email", value = email)
}
}

override fun subscribeOnBookingsList(
workspaceId: String,
scope: CoroutineScope
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ class ApiMock(private val realApi: Api, mockFactory: MockFactory) : Api {
awaitClose()
}


override suspend fun getUserByEmail(email: String): Either<ErrorResponse, UserDTO> =
response(
mock = users.value.find { user ->
Expand Down

0 comments on commit 7020a77

Please sign in to comment.