diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/collection/fragment/CollectionViewModel.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/collection/fragment/CollectionViewModel.kt index 516f1c8f..10bf08db 100644 --- a/app/src/main/java/es/verdnatura/presentation/view/feature/collection/fragment/CollectionViewModel.kt +++ b/app/src/main/java/es/verdnatura/presentation/view/feature/collection/fragment/CollectionViewModel.kt @@ -969,4 +969,28 @@ class CollectionViewModel(val context: Context) : BaseViewModel(context) { }) } + fun saleTrackingSectorCollectionAddPrevOK( + sectorCollectionFk: Int + ) { + salix.saleTrackingSectorCollectionAddPrevOK(arrayListOf(sectorCollectionFk)) + .enqueue(object : SalixCallback(context) { + override fun onError(t: Throwable) { + _responseSaleAddPrevOK.value = ResponseItemVO( + isError = true, errorMessage = getMessageFromAllResponse( + nameofFunction(this), t.message!! + ) + ) + + } + + override fun onSuccess(response: Response) { + _responseSaleAddPrevOK.value = ResponseItemVO( + isError = false, errorMessage = "" + getMessageFromAllResponse( + nameofFunction(this), response.message() + ) + ) + } + }) + } + }