I have a Functional Component that retrieves a list of objects upon rendering. Then, I run a foreach loop with it and it works perfectly! Afterwards, I make http requests with each of these objects to make a new array of objects... But I can't use its foreach, as if I formatted something wrong. I printed both arrays to the console and they look different. Help Please!!
interface minterface
{result: string;
res: number;
pos: number;
}
let analyzedAppReviews: minterface[] = [];
try {
const { data } = await ailab.post(
`text/classification/predict/${ailabKey}`,
{
text: reviewText,
}
);
let aiLabObj = {} as ailabInterface
aiLabObj.result = data.result;
aiLabObj.confidence_score = data.confidence_score;
aiLabObj.processing_time = data.processing_time;
analyzedAppReviews.push(aiLabObj);
}