From 2f7ee2b82cda39f6bd94c5200b83563418b68dd7 Mon Sep 17 00:00:00 2001 From: Marcin Aman Date: Thu, 17 Dec 2020 10:17:45 +0100 Subject: Navigate to root after logo click, add data to searchbars on multimodule (#1631) --- plugins/base/frontend/src/main/components/utils/requests.tsx | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 plugins/base/frontend/src/main/components/utils/requests.tsx (limited to 'plugins/base/frontend/src/main/components/utils') diff --git a/plugins/base/frontend/src/main/components/utils/requests.tsx b/plugins/base/frontend/src/main/components/utils/requests.tsx new file mode 100644 index 00000000..4a14e6f6 --- /dev/null +++ b/plugins/base/frontend/src/main/components/utils/requests.tsx @@ -0,0 +1,7 @@ +import { IWindow } from "../search/types" + +export const relativizeUrlForRequest = (filePath: string) : string => { + const pathToRoot = (window as IWindow).pathToRoot + const relativePath = pathToRoot == "" ? "." : pathToRoot + return relativePath.endsWith('/') ? `${relativePath}${filePath}` : `${relativePath}/${filePath}` +} \ No newline at end of file -- cgit