refs #6559feat:refactor get_sectors

This commit is contained in:
Sergio De la torre 2024-02-09 08:08:24 +01:00
parent 0445ac0442
commit bd6fda1130
2 changed files with 8 additions and 2 deletions

View File

@ -79,6 +79,11 @@ interface SalixService {
fun getSectorsSalix(
): Call<List<SectorItemVO>>
@GET("sectors")
fun getSectors(
@Query("filter") filter: String
): Call<List<SectorItemVO>>
@GET("collections/getCollection")
fun getCollectionSalix(
): Call<List<CollectionVO>>

View File

@ -64,7 +64,6 @@ class AjustesViewModel(val context: Context) : BaseViewModel(context) {
val operatorGetTrainResponse: LiveData<ResponseItemVO>
get() = _operatorGetTrainResponse
private val _workerAllowedResponse by lazy { MutableLiveData<ResponseItemVO>() }
val workerAllowedResponse: LiveData<ResponseItemVO>
get() = _workerAllowedResponse
@ -219,7 +218,9 @@ class AjustesViewModel(val context: Context) : BaseViewModel(context) {
}
fun getSectorsSalix() {
salix.getSectorsSalix().enqueue(object : SalixCallback<List<SectorItemVO>>(context) {
salix.getSectors("""{"fields":["id","description","warehouseFk"],"order":"description"}""")
// salix.getSectorsSalix()
.enqueue(object : SalixCallback<List<SectorItemVO>>(context) {
override fun onError(t: Throwable) {
val listError: ArrayList<SectorItemVO> = ArrayList()