When I console.log() paymentsResults and pendingResults from the code below, I can see the data being logged properly. However, right at the last moment when I am trying to return payments and pending I see the results as Promise { <pending> } in my backend. What is the reason and how can I fix the issue here?
const query = await pool.query(q);
const payments = query.rows.filter(o => getCategory(o) === "payment");
const pending = query.rows.filter(o => getCategory(o) === "pending");
const inactive = query.rows.filter(o => getCategory(o) === "inactive");
const paymentsResults = payments.map(async order => {
    const A = ({
        date: getDate(order),
        item: await getItem(order),
        total: getTotal(order),
        purchaser: getPurchaser(order),
        email: getEmail(order),
        paymentMethod: getPaidUsing(order),
        status: getStatus(order)
    });
    return A;
});
const pendingResults = pending.map(async order => {
    const B = {
        date: getDate(order),
        item: await getItem(order),
        total: getTotal(order),
        purchaser: getPurchaser(order),
        email: getEmail(order),
        status: getStatus(order)
    };
    return B;
});
return {
    payments: paymentsResults,
    pending: pendingResults,
    inactive: inactive
};
};
 
     
    