From bd6fda11308f1279a4c7ecdd19629ec6d0b0f0c7 Mon Sep 17 00:00:00 2001 From: Sergio De la torre Date: Fri, 9 Feb 2024 08:08:24 +0100 Subject: [PATCH] refs #6559feat:refactor get_sectors --- app/src/main/java/es/verdnatura/domain/SalixService.kt | 5 +++++ .../view/feature/ajustes/fragment/AjustesViewModel.kt | 5 +++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/es/verdnatura/domain/SalixService.kt b/app/src/main/java/es/verdnatura/domain/SalixService.kt index f7bcf33b..c036902c 100644 --- a/app/src/main/java/es/verdnatura/domain/SalixService.kt +++ b/app/src/main/java/es/verdnatura/domain/SalixService.kt @@ -79,6 +79,11 @@ interface SalixService { fun getSectorsSalix( ): Call> + @GET("sectors") + fun getSectors( + @Query("filter") filter: String + ): Call> + @GET("collections/getCollection") fun getCollectionSalix( ): Call> diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/ajustes/fragment/AjustesViewModel.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/ajustes/fragment/AjustesViewModel.kt index 792fc43b..e91c184d 100644 --- a/app/src/main/java/es/verdnatura/presentation/view/feature/ajustes/fragment/AjustesViewModel.kt +++ b/app/src/main/java/es/verdnatura/presentation/view/feature/ajustes/fragment/AjustesViewModel.kt @@ -64,7 +64,6 @@ class AjustesViewModel(val context: Context) : BaseViewModel(context) { val operatorGetTrainResponse: LiveData get() = _operatorGetTrainResponse - private val _workerAllowedResponse by lazy { MutableLiveData() } val workerAllowedResponse: LiveData get() = _workerAllowedResponse @@ -219,7 +218,9 @@ class AjustesViewModel(val context: Context) : BaseViewModel(context) { } fun getSectorsSalix() { - salix.getSectorsSalix().enqueue(object : SalixCallback>(context) { + salix.getSectors("""{"fields":["id","description","warehouseFk"],"order":"description"}""") + // salix.getSectorsSalix() + .enqueue(object : SalixCallback>(context) { override fun onError(t: Throwable) { val listError: ArrayList = ArrayList()