From 1d66079e1167d549939e02bfb909b4feebe95b5e Mon Sep 17 00:00:00 2001 From: sabhas Date: Fri, 22 Oct 2021 18:22:55 +0000 Subject: [PATCH] chore(web): remove baseUrl from axios requests --- web/src/containers/Drive/main.tsx | 8 ++++---- web/src/containers/Drive/sideBar.tsx | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/web/src/containers/Drive/main.tsx b/web/src/containers/Drive/main.tsx index fd8b323..c45484d 100644 --- a/web/src/containers/Drive/main.tsx +++ b/web/src/containers/Drive/main.tsx @@ -19,16 +19,16 @@ const Main = (props: any) => { const [editMode, setEditMode] = useState(false) useEffect(() => { - if (props.selectedFilePath !== '') { + if (props.selectedFilePath) { setIsLoading(true) axios - .get(`${baseUrl}/SASjsApi/files?filePath=${props.selectedFilePath}`) + .get(`/SASjsApi/files?filePath=${props.selectedFilePath}`) .then((res: any) => { setIsLoading(false) setFileContent(res.data.fileContent) }) } - }, [props.selectedFilePath, baseUrl]) + }, [props.selectedFilePath]) const handleEditSaveBtnClick = () => { if (!editMode) { @@ -37,7 +37,7 @@ const Main = (props: any) => { } else { setIsLoading(true) axios - .post(`${baseUrl}/SASjsApi/files`, { + .post(`/SASjsApi/files`, { filePath: props.selectedFilePath, fileContent: fileContent }) diff --git a/web/src/containers/Drive/sideBar.tsx b/web/src/containers/Drive/sideBar.tsx index 9311116..8cb8e95 100644 --- a/web/src/containers/Drive/sideBar.tsx +++ b/web/src/containers/Drive/sideBar.tsx @@ -44,14 +44,14 @@ const SideBar = (props: any) => { const [directoryData, setDirectoryData] = useState(null) useEffect(() => { - axios.get(`${baseUrl}/SASjsApi/executor`).then((res: any) => { + axios.get(`/SASjsApi/executor`).then((res: any) => { if (res.data && res.data?.status === 'success') { setDirectoryData(res.data.tree) } }) const queryParams = new URLSearchParams(location.search) props.setSelectedFilePath(queryParams.get('filePath')) - }, [baseUrl, location.search, props]) + }, [location.search, props]) const handleSelect = (node: TreeNode) => { if (!node.children.length) {