From 7c498d0b92542decdcc7d3bc2b33bfc6da234783 Mon Sep 17 00:00:00 2001 From: Poh Anson <50758680+PohAnson@users.noreply.github.com> Date: Mon, 9 Dec 2024 01:25:55 +0800 Subject: [PATCH] Remove feature where the debug page auto query on load. This is to reduce the unnecessary debug calls. --- components/debug/APIComponent.js | 26 -------------------------- 1 file changed, 26 deletions(-) diff --git a/components/debug/APIComponent.js b/components/debug/APIComponent.js index 6e228a55..a1b7e1b0 100644 --- a/components/debug/APIComponent.js +++ b/components/debug/APIComponent.js @@ -10,32 +10,6 @@ export function APIComponent({ baseURL, path }) { useEffect(() => { setUrl(baseURL + path); - // Run initial GET request to check API and set payload - const fetchData = async () => { - try { - const res = await axiosInstance.get(baseURL + path, { - headers: { - 'Content-Type': 'application/json', - }, - }); - - setResponse(res.data); - - let templateData = res.data; - - if (Array.isArray(res.data) && res.data.length > 0) { - templateData = res.data[0]; - } - - if (typeof templateData === 'object') { - setPayload(JSON.stringify(templateData, null, 2)); - } - } catch (err) { - setError(err.message); - } - }; - - fetchData(); }, [baseURL, path]); const handleSubmit = async e => {