Skip to content

Commit

Permalink
Merge pull request #80 from leben-in-deutschland/feature/inform-user-…
Browse files Browse the repository at this point in the history
…about-new-questions

fixed null for questions
  • Loading branch information
manishtiwari25 authored Feb 25, 2025
2 parents 532f974 + 72454de commit 672592a
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/scrap/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,7 @@ const translate = async (question: Question) => {
context: translatedResults[5].translations.find((t: any) => t.to === lang)?.text || ''
};
}
question.translation = translations;
return question;
return translations;
} catch (err) {
console.error('Error processing questions:', err);
}
Expand Down Expand Up @@ -180,9 +179,9 @@ async function scrapeData() {
allQuestion[i].category = oldQuestion[existing].category;
allQuestion[i].context = oldQuestion[existing].context;
} else {
allQuestion[i].translation = await translate(allQuestion[i]);
allQuestion[i].category = await findCategory(allQuestion[i]);
allQuestion[i].context = await getContext(allQuestion[i]);
allQuestion[i] = await translate(allQuestion[i]);
}
}
const dir = './data';
Expand Down

0 comments on commit 672592a

Please sign in to comment.