I have an app that looks for local businesses near the user. Right now I use a loop within an action to search for businesses and based on the number of responses from the API, tries again. This works fine but I'm having a heck of a time sorting that list by the distance field in the API response.
I believe converting the API response data to a custom data type may give me that ability (?), but I can't seem to get the API response to write a page or app state of the custom data type within the action.
This works but doesn't cast the response to a more manipulable data type:
This does not work: (Nor does anything else I've tried!)
Any thoughts on how I can get this working or what I'm doing wrong here? All I see is "null" when testing.