const items = await news.getRawMany();
return {
items: items.map(async item => {
let category = await this.getCompanyNewsCategory(item['category_id']);
return {
id: category,
}})
};
return Promise.all(items.map(async item => {
let category = await this.getCompanyNewsCategory(item['category_id']);
return {
id: category,
}}))
Если без объекта, то все работает
const items = await news.getRawMany();
return {
items: await Promise.all(items.map(async item => {
let category = await this.getCompanyNewsCategory(item['category_id']);
return {
id: category,
}}))
};