fix(stage): route media uploads to production api.canina.ir without duplication
Deploy Canina / deploy (push) Successful in 2m22s
E2E Playwright Tests / Run Full E2E & Security Suites (push) Failing after 7s

This commit is contained in:
devops committed 2026-10-13 22:23:01 +00:00
1 parent ff3f819fb6
commit 7f10dad448
1 file changed
+2 -4
+2 -4
View File
@@ -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}`;
}