Commit c70a92c2 authored by Vladislav Bogdashkin's avatar Vladislav Bogdashkin 🎣

fix offers.getTours return type

parent 4168f8e7
...@@ -63,8 +63,10 @@ class BigantoRetrofitRepository @Inject constructor(@Named("bigantoApi") retrof ...@@ -63,8 +63,10 @@ class BigantoRetrofitRepository @Inject constructor(@Named("bigantoApi") retrof
override fun getOfferTours(multiTourId:Int): Observable<List<TourPreviewRaw>> = override fun getOfferTours(multiTourId:Int): Observable<List<TourPreviewRaw>> =
api api
.getOfferTours(offerId = multiTourId) .getOfferTours(offerId = multiTourId)
.compose(RetrofitResponseValidation()) .compose(RetrofitResponseValidation())
.map { it.data[multiTourId]?.toList()?: error("No tours avaliable")}
.map { it[multiTourId.toString()]?.toList()?: error("No tours avaliable")}
.doOnError { e(it) } .doOnError { e(it) }
.subscribeOn(Schedulers.io()) .subscribeOn(Schedulers.io())
} }
......
package com.biganto.visual.roompark.data.repository.api.biganto package com.biganto.visual.roompark.data.repository.api.biganto
import com.biganto.visual.roompark.data.repository.api.biganto.raw.AppVersionRaw import com.biganto.visual.roompark.data.repository.api.biganto.raw.AppVersionRaw
import com.biganto.visual.roompark.data.repository.api.biganto.raw.OfferTours
import com.biganto.visual.roompark.data.repository.api.biganto.raw.TourFilesDataRaw import com.biganto.visual.roompark.data.repository.api.biganto.raw.TourFilesDataRaw
import com.biganto.visual.roompark.data.repository.api.biganto.raw.TourPreviewRaw import com.biganto.visual.roompark.data.repository.api.biganto.raw.TourPreviewRaw
import com.google.gson.JsonArray import com.google.gson.JsonArray
...@@ -147,7 +146,7 @@ interface IBigantoMobileApi { ...@@ -147,7 +146,7 @@ interface IBigantoMobileApi {
@Query(API_VERSION_PARAM) apiVersion: String = DEFAULT_API_VERSION, @Query(API_VERSION_PARAM) apiVersion: String = DEFAULT_API_VERSION,
@Query(LANG_PARAM) languageCode: String = Locale.getDefault().language, @Query(LANG_PARAM) languageCode: String = Locale.getDefault().language,
@Query(OFFER_GET_TOURS_ID) offerId: Int @Query(OFFER_GET_TOURS_ID) offerId: Int
): Observable<Response<OfferTours>> ): Observable<Response<Map<String,List<TourPreviewRaw>>>>
@Streaming @Streaming
@GET @GET
......
...@@ -96,7 +96,7 @@ data class TourGetFilesRaw( ...@@ -96,7 +96,7 @@ data class TourGetFilesRaw(
) )
data class OfferTours( data class OfferTours(
val data: Map<Int,List<TourPreviewRaw>>, val data: Map<String,List<TourPreviewRaw>>,
val errors:List<ErrorRaw>? val errors:List<ErrorRaw>?
) )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment