Recently, I have been tackling an issue with my API that is built with TypeScript and NodeJS. The problem arises when my Promises seem to not resolve correctly in the following code snippet:
async function retrieveData() {
return new Promise((resolve) => {
resolve(
prisma.raw<Type>(
query
)
);
});
}
async function fetchData() {
return new Promise((resolve) => {
resolve(
prisma.raw<Type>(
query
)
);
});
}
const dataOne: any = await retrieveData();
const dataTwo: any = await fetchData();
dataOne.property.push(dataTwo[i]);
Despite my efforts, I keep encountering the same error mentioned in the title. Finding a solution to this has proven to be quite challenging.