fix(stage): route media uploads to production api.canina.ir without duplication
This commit is contained in:
1 parent
ff3f819fb6
commit
7f10dad448
1 file changed
+2
-4
@@ -39,10 +39,8 @@ export function getMediaUrl(url?: string | null): string {
|
||||
}
|
||||
|
||||
if (uploadPath) {
|
||||
const isStage = typeof window !== 'undefined' && window.location.hostname.includes('stage');
|
||||
const isDev = process.env.NODE_ENV === 'development';
|
||||
const backendBase = process.env.NEXT_PUBLIC_API_URL?.replace(/\/api\/?$/, '') ||
|
||||
(isDev ? 'http://localhost:4400' : isStage ? 'https://stageapi.canina.ir' : 'https://api.canina.ir');
|
||||
// All environments consume production media uploads directly (no duplication)
|
||||
const backendBase = 'https://api.canina.ir';
|
||||
return `${backendBase}/uploads/${uploadPath}`;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user