From 9a928cd12350dea1b827230819549418b378c2ea Mon Sep 17 00:00:00 2001 From: NancyAanchal Date: Thu, 15 Aug 2024 23:20:36 +0545 Subject: [PATCH] succesfully made it cache data for all g-translate languages --- nepalingo-web/src/lib/getGTranslate.tsx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/nepalingo-web/src/lib/getGTranslate.tsx b/nepalingo-web/src/lib/getGTranslate.tsx index 201ab96..90d588f 100644 --- a/nepalingo-web/src/lib/getGTranslate.tsx +++ b/nepalingo-web/src/lib/getGTranslate.tsx @@ -10,7 +10,7 @@ const languageCodes: { [key: string]: string } = { export const getGTranslate = async ( language: string, - word: string + word: string, ): Promise<{ language: string; word: string; @@ -37,7 +37,6 @@ export const getGTranslate = async ( console.error("Error fetching from cache:", error); } else if (cachedResult) { const translatedWord = cachedResult.translated_word; - console.log("used table"); return { language, word, @@ -52,7 +51,6 @@ export const getGTranslate = async ( } const url = `https://translation.googleapis.com/language/translate/v2?key=${GOOGLE_TRANSLATE_API_KEY}&q=${word}&target=${targetLanguage}`; - console.log("used api"); const response = await fetch(url); const data = await response.json();