s3
This commit is contained in:
@@ -1,13 +0,0 @@
|
||||
export const getImageUrl = (imagePath: string): string => {
|
||||
// Get the base URL without /api
|
||||
const apiUrl = process.env.REACT_APP_API_URL || '';
|
||||
const baseUrl = apiUrl.replace('/api', '');
|
||||
|
||||
// If imagePath already includes the full path, use it
|
||||
if (imagePath.startsWith('/uploads/')) {
|
||||
return `${baseUrl}${imagePath}`;
|
||||
}
|
||||
|
||||
// Otherwise, construct the full path
|
||||
return `${baseUrl}/uploads/profiles/${imagePath}`;
|
||||
};
|
||||
Reference in New Issue
Block a user