Quellcode durchsuchen

remove console logs

tonyboylehub vor 11 Monaten
Ursprung
Commit
55cc52d98c

+ 0 - 4
src/components/apiComponents/apiComponentWrapper.jsx

@@ -39,8 +39,6 @@ const ApiComponentWrapper = (args) => {
 
     setSelectedExample(index)
     if (activeEndpoint.name !== 'Custom') {
-      console.log(activeEndpoint)
-      console.log(api.examples[index])
       setActiveEndpoint(endpoints[api.examples[index].chain])
     }
   }
@@ -130,8 +128,6 @@ const ApiComponentWrapper = (args) => {
 
     const resJson = await res.json()
 
-    console.log(resJson)
-
     setResponce(resJson)
 
     setIsLoading(false)

+ 18 - 12
src/components/apiComponents/languageComponents/javascriptRequestRenderer.jsx

@@ -1,8 +1,14 @@
-import { Fence } from "@/components/Fence";
-
-
-const JavaScriptRequestRenderer = ({ url, headers, bodyMethod, rpcVersion, bodyParams, id }) => {
-  const httpBody = bodyParams;
+import { Fence } from '@/components/Fence'
+
+const JavaScriptRequestRenderer = ({
+  url,
+  headers,
+  bodyMethod,
+  rpcVersion,
+  bodyParams,
+  id,
+}) => {
+  const httpBody = bodyParams
 
   const object = {
     method: 'POST',
@@ -13,15 +19,15 @@ const JavaScriptRequestRenderer = ({ url, headers, bodyMethod, rpcVersion, bodyP
       method: bodyMethod,
       params: httpBody,
     },
-  };
+  }
 
   // Dynamically generate headers for JavaScript
   const headersCode = Object.entries(headers)
     .map(([key, value]) => `"${key}": "${value}"`)
-    .join(',\n');
+    .join(',\n')
 
   // Format the body with indentation
-  const jsonBody = JSON.stringify(object.body, null, 2);  // 4-space indentation for JSON
+  const jsonBody = JSON.stringify(object.body, null, 2) // 4-space indentation for JSON
 
   const code = `const url = "${url}";
 
@@ -33,13 +39,13 @@ fetch(url, {
 .then(response => response.json())
 .then(data => console.log(data))
 .catch(error => console.error("Error:", error));
-`;
+`
 
   return (
     <Fence className="w-full" language="javascript">
       {code}
     </Fence>
-  );
-};
+  )
+}
 
-export default JavaScriptRequestRenderer;
+export default JavaScriptRequestRenderer

+ 0 - 2
src/components/apiComponents/languageRenderer.jsx

@@ -24,8 +24,6 @@ const LanguageRenderer = ({ api, body, setActiveEndpoint, activeEndpoint }) => {
       ? api.headers
       : { 'Content-Type': 'application/json' }
 
-    console.log({ activeEndpoint })
-
     switch (activeLanguage) {
       case 'javascript':
         return (