I have a data class that looks like this: ```data...
# mvrx
c
I have a data class that looks like this:
Copy code
data class FeaturedState(
        val hospitalData: HospitalsViewModel = HospitalsViewModel(),
        val dealsData: DealsViewModel = DealsViewModel(),
        val marketingType: MarketingType = MarketingType.generalHealth
) : MvRxState
I’m attempting to morph both
hospitalData
and
dealsData
on two separate api calls. However when I try to change the value of
dealsData
, I receive this error:
Change parameter hospitalData type primary constructor class of class FeaturedState to DealsViewModel
Not sure what I’m doing wrong that it’s trying to set it on hospitalData instead of dealsData. Here is the function that runs the API calls: https://hatebin.com/owjqvhydaz
e
you can’t have a viewmodel as a property inside of your data class