π₯π₯π₯ Open-source Jira, Linear, Monday, and ClickUp alternative. Plane is a modern project management platform to manage tasks, sprints, docs, and triage.
TypeScript boardsbug-trackerdjangodockerganttissue-trackerjirajira-alternativekanbanlinearpostgresqlproduct-managementproject-managementproject-planningpythonreactredistypesciptvitework-management
[WEB-310] regression: generate file url function (#5811)
Aaryan Khandelwale404450e1a79
diff --git a/admin/helpers/file.helper.ts b/admin/helpers/file.helper.tsindex 627b3b7d09..6e1f546360 100644--- a/admin/helpers/file.helper.ts+++ b/admin/helpers/file.helper.ts@@ -1,6 +1,5 @@// helpersimport { 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.tsindex fef071ed32..b149ebc7cf 100644--- a/space/helpers/file.helper.ts+++ b/space/helpers/file.helper.ts@@ -2,7 +2,6 @@import { TFileMetaDataLite, TFileSignedURLResponse } from "@plane/types";// helpersimport { 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.tsindex 32570da5bd..a64177a7ab 100644--- a/web/helpers/file.helper.ts+++ b/web/helpers/file.helper.ts@@ -2,7 +2,6 @@import { TFileMetaDataLite, TFileSignedURLResponse } from "@plane/types";// helpersimport { 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}`;};