diff --git a/admin/helpers/file.helper.ts b/admin/helpers/file.helper.ts index 627b3b7d0..6e1f54636 100644 --- a/admin/helpers/file.helper.ts +++ b/admin/helpers/file.helper.ts @@ -1,6 +1,5 @@ // helpers import { API_BASE_URL } from "@/helpers/common.helper"; -import { checkURLValidity } from "@/helpers/string.helper"; /** * @description combine the file path with the base URL @@ -9,7 +8,7 @@ import { checkURLValidity } from "@/helpers/string.helper"; */ export const getFileURL = (path: string): string | undefined => { if (!path) return undefined; - const isValidURL = checkURLValidity(path); + const isValidURL = path.startsWith("http"); if (isValidURL) return path; return `${API_BASE_URL}${path}`; }; diff --git a/space/helpers/file.helper.ts b/space/helpers/file.helper.ts index fef071ed3..b149ebc7c 100644 --- a/space/helpers/file.helper.ts +++ b/space/helpers/file.helper.ts @@ -2,7 +2,6 @@ import { TFileMetaDataLite, TFileSignedURLResponse } from "@plane/types"; // helpers import { API_BASE_URL } from "@/helpers/common.helper"; -import { checkURLValidity } from "@/helpers/string.helper"; /** * @description from the provided signed URL response, generate a payload to be used to upload the file @@ -24,7 +23,7 @@ export const generateFileUploadPayload = (signedURLResponse: TFileSignedURLRespo */ export const getFileURL = (path: string): string | undefined => { if (!path) return undefined; - const isValidURL = checkURLValidity(path); + const isValidURL = path.startsWith("http"); if (isValidURL) return path; return `${API_BASE_URL}${path}`; }; diff --git a/web/helpers/file.helper.ts b/web/helpers/file.helper.ts index 32570da5b..a64177a7a 100644 --- a/web/helpers/file.helper.ts +++ b/web/helpers/file.helper.ts @@ -2,7 +2,6 @@ import { TFileMetaDataLite, TFileSignedURLResponse } from "@plane/types"; // helpers import { API_BASE_URL } from "@/helpers/common.helper"; -import { checkURLValidity } from "@/helpers/string.helper"; /** * @description from the provided signed URL response, generate a payload to be used to upload the file @@ -24,7 +23,7 @@ export const generateFileUploadPayload = (signedURLResponse: TFileSignedURLRespo */ export const getFileURL = (path: string): string | undefined => { if (!path) return undefined; - const isValidURL = checkURLValidity(path); + const isValidURL = path.startsWith("http"); if (isValidURL) return path; return `${API_BASE_URL}${path}`; };