Merge pull request #87 from SlimusMinus/fix-get_image
All checks were successful
deploy-frontend / deploy (push) Successful in 51s
All checks were successful
deploy-frontend / deploy (push) Successful in 51s
fixed get image url
This commit is contained in:
@@ -1,10 +1,10 @@
|
|||||||
export const API_URL = process.env.REACT_APP_API_URL || "http://localhost:8080";
|
export const API_URL = process.env.REACT_APP_API_URL || "http://localhost:8080";
|
||||||
|
|
||||||
export function getImageUrl(filename) {
|
export function getImageUrl(filename) {
|
||||||
if (!filename) return null;
|
if (!filename) return null;
|
||||||
if (filename.startsWith("http")) return filename;
|
if (filename.startsWith("http")) return filename;
|
||||||
if (filename.startsWith("/")) return `${API_URL}${filename}`;
|
if (filename.startsWith("/")) return `${API_URL}${filename}`;
|
||||||
return `${API_URL}/api/v1/files/${filename}`;
|
return `${API_URL}/api/v1/files/${filename}?presigned=true`;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const SUPPORT_EMAIL = process.env.REACT_APP_SUPPORT_EMAIL || "support@nakhodka.app";
|
export const SUPPORT_EMAIL = process.env.REACT_APP_SUPPORT_EMAIL || "support@nakhodka.app";
|
||||||
|
|||||||
Reference in New Issue
Block a user