I couldn't map the second API response https://api.coingecko.com/api/v3/global with error prompted (read property 'map' of undefined), while the first API is fine. Whats the issue here?
export default function Home(props) {
const { data } = props.result;
const { global } = props.nextResult;
<table className="table2 table-hover table-dark">
<thead>
<tr>
<th>Markets</th>
</tr>
</thead>
<tbody>
{global.map (gg => (
<tr key={gg.endedicos}>
<td>{gg.markets}</td>
</tr>
))}
</tbody>
</table>
export async function getServerSideProps(context) {
const params = {
order: CoinGecko.ORDER.MARKET_CAP_DESC
};
const [result, nextResult] = await Promise.all([
coinGeckoClient.coins.markets({params}),
coinGeckoClient.global()
]);
return {
props: {
result, nextResult
},
}
}