feat getAddress #refs 7622

This commit is contained in:
Sergio De la torre 2024-07-19 16:26:16 +02:00
parent 962ba75bfa
commit 9c84f25c0c
1 changed files with 13 additions and 0 deletions

View File

@ -209,6 +209,19 @@ class ItemCardViewModel(var context: Context) : BaseViewModel(context) {
fun getAddress() {
salix.getAddressSalix("""{ "include": [ { "relation": "address", "scope": { "fields": { "nickname": true } } } ] }""")
.enqueue(object : SalixCallback<List<AddressLoses>>(context) {
override fun onSuccess(response: Response<List<AddressLoses>>) {
_addressLosesList.value = response.body()?.let { AddressLosesList(it) }
}
override fun onError(t: Throwable) {
getAddressNew()
}
})
}
//Tarea 7622 retroCompatible, borrar getAddress y renombra getAddressNew a getAddress.
fun getAddressNew() {
salix.getAddressSalixNew("""{"where":{"type":"internal"}, "include": [ { "relation": "address", "scope": { "fields": { "nickname": true } } } ] }""")
.enqueue(object : SalixCallback<List<AddressLoses>>(context) {
override fun onSuccess(response: Response<List<AddressLoses>>) {
_addressLosesList.value = response.body()?.let { AddressLosesList(it) }