Im having trouble combining two async variables into one array:
My code:
async function fetchMenus ({actions, state}) {
return actions.theme.fetchToken().then(async () => {
const items = await fetch("url", {
method: "GET",
headers: {
Authorization: `Bearer ${state.theme.token}`,
},
});
const menu = await fetch("url", {
method: "GET",
headers: {
Authorization: `Bearer ${state.theme.token}`,
},
});
return [menu.json(), items.json()];
});
};
As a response i recieve 2 fulfilled promises, but i want to receive the results. How can i solve this?

.thenwith await inline #2await. Why not use it on the promises for the json body as well?