mirror of
https://github.com/towfiqi/serpbear
synced 2025-06-26 18:15:54 +00:00
fix: Resolves Google Ads search volume data loading issue.
This commit is contained in:
parent
649f412303
commit
12eac2b012
@ -36,14 +36,13 @@ const updatekeywordVolume = async (req: NextApiRequest, res: NextApiResponse<Key
|
|||||||
keywordsToSend = parseKeywords(allKeywords.map((e) => e.get({ plain: true })));
|
keywordsToSend = parseKeywords(allKeywords.map((e) => e.get({ plain: true })));
|
||||||
}
|
}
|
||||||
if (domain) {
|
if (domain) {
|
||||||
// const allDomain = domain === 'all';
|
const allDomain = domain === 'all';
|
||||||
// const allKeywords:Keyword[] = allDomain ? await Keyword.findAll() : await Keyword.findAll(allDomain ? {} : { where: { domain } });
|
const allKeywords:Keyword[] = allDomain ? await Keyword.findAll() : await Keyword.findAll(allDomain ? {} : { where: { domain } });
|
||||||
// keywordsToSend = parseKeywords(allKeywords.map((e) => e.get({ plain: true })));
|
keywordsToSend = parseKeywords(allKeywords.map((e) => e.get({ plain: true })));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (keywordsToSend.length > 0) {
|
if (keywordsToSend.length > 0) {
|
||||||
const keywordsVolumeData = await getKeywordsVolume(keywordsToSend);
|
const keywordsVolumeData = await getKeywordsVolume(keywordsToSend);
|
||||||
// console.log('keywordsVolumeData :', keywordsVolumeData);
|
|
||||||
if (keywordsVolumeData.error) {
|
if (keywordsVolumeData.error) {
|
||||||
return res.status(400).json({ keywords: [], error: keywordsVolumeData.error });
|
return res.status(400).json({ keywords: [], error: keywordsVolumeData.error });
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user