Hi,
I’ve got a server side action that has two database queries from seperate tables, each generating an array/list, that are very similar. Examples below:
query1
[
{ id: 133, name: "john" },
{ id: 565, name: "joe" },
{ id: 399, name: "james" },
]
query2
[
{ id: 102, name: "tom" } ,
{ id: 382, name: "terry" },
{ id: 311, name: "tanya" },
]
How can I join these 2 queries/arrays/lists on server side to achieve the expected output below?
I’ve tried things like the ‘join’ action, and also tried manually setting a value that does a javasccript style query1.concat(query2), and tried on client-side too but can’t seem to work it out.
Any suggestions on how to join 2 arrays/lists together server-side? Or even client-side?
Expected output
[
{ id: 133, name: "john" },
{ id: 565, name: "joe" },
{ id: 399, name: "james" },
{ id: 102, name: "tom" } ,
{ id: 382, name: "terry" },
{ id: 3, name: "tanya" },
]