From an API Call json, correctly populates one list, but not another from that same json

Here is the github link to see what im talking about.
https://github.com/Hahnstrong/SASiAdmin/tree/develop

On the welcome page, it makes the API call, brings down all the users and all their data, including their lists of orders and vehicles. On the MainPage, when you click on someone, it sends that user data to the next page. On the UserInfoPage, it separates all the necessary info into specific variables (including Order and Vehicle lists). And then when you click on the Vehicles button, it correctly moves that array into the Backend to be displayed on the following page. However, if I click on Orders, it gives me this error, and I am unsure why.

Error: replaceAll(): argument must be an array.

I am pretty sure it is the same type of array as the vehicles list.

When checking the app, I generally use myself, Caleb Strong, as the user to click on, since I have both vehicles and orders in my data, however run through several different people if you want.

Hey Caleb!

In UserInfo.js you should change this line:

var orders = user.map(function(x) { return x.orders; });

to this:

var orders = user.onValueChange(module, function(x) { return x.orders; });

I tried that, but it threw this error.

[Viewport]: Error: TypeError: user.onValueChange is not a function: Name: TypeError: user.onValueChange is not a function
Error message: Uncaught TypeError: user.onValueChange is not a function
File name: Pages/UserInfo.js
Line number: 23
Source line: var orders = user.onValueChange(module, function(x) { return x.orders; });
JS stack trace: TypeError: user.onValueChange is not a function
at Object._tempMethod (Pages/UserInfo.js:23:19)
in Fuse.Scripting.DiagnosticSubject<Pages/UserInfo.js:23>

Hey!

Sorry for my typo, there should be onValueChanged, not onValueChange.

You can leave this line as it is:

var orders = user.map(function(x) { return x.orders; });

Just add orders in module.exports to subscribe to this Observable.

Hope this helps.

Wow, I knew I was missing something small haha. Thanks for that!