Refactor using hooks rules

This commit is contained in:
David
2021-03-11 13:29:22 +01:00
parent 27ffaa425c
commit f7897061fc
2 changed files with 13 additions and 17 deletions

View File

@@ -10,7 +10,7 @@ export async function googleScrape(
error?: number
}> {
const parsed = replaceBoth("mapping", { source, target });
const res = await fetch(`https://translate.google.com/m?sl=${parsed.source}&tl=${parsed.target}&q=${encodeURI(query)}`);
const res = await fetch(`https://translate.google.com/m?sl=${parsed.source}&tl=${parsed.target}&q=${encodeURIComponent(query)}`);
if (!res.ok)
return {