Skip to content

Commit

Permalink
fix: Resolves Google Ads search volume data loading issue.
Browse files Browse the repository at this point in the history
  • Loading branch information
towfiqi committed Nov 14, 2024
1 parent 649f412 commit 12eac2b
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions pages/api/volume.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,13 @@ const updatekeywordVolume = async (req: NextApiRequest, res: NextApiResponse<Key
keywordsToSend = parseKeywords(allKeywords.map((e) => e.get({ plain: true })));
}
if (domain) {
// const allDomain = domain === 'all';
// const allKeywords:Keyword[] = allDomain ? await Keyword.findAll() : await Keyword.findAll(allDomain ? {} : { where: { domain } });
// keywordsToSend = parseKeywords(allKeywords.map((e) => e.get({ plain: true })));
const allDomain = domain === 'all';
const allKeywords:Keyword[] = allDomain ? await Keyword.findAll() : await Keyword.findAll(allDomain ? {} : { where: { domain } });
keywordsToSend = parseKeywords(allKeywords.map((e) => e.get({ plain: true })));
}

if (keywordsToSend.length > 0) {
const keywordsVolumeData = await getKeywordsVolume(keywordsToSend);
// console.log('keywordsVolumeData :', keywordsVolumeData);
if (keywordsVolumeData.error) {
return res.status(400).json({ keywords: [], error: keywordsVolumeData.error });
}
Expand Down

0 comments on commit 12eac2b

Please sign in to comment.