From 7f10dad448afd6184efaef856d20f74139cab6cc Mon Sep 17 00:00:00 2001 From: devops Date: Tue, 13 Oct 2026 22:23:01 +0000 Subject: [PATCH] fix(stage): route media uploads to production api.canina.ir without duplication --- frontend/application/lib/media.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/frontend/application/lib/media.ts b/frontend/application/lib/media.ts index 76dc5b6a..c96ef71a 100644 --- a/frontend/application/lib/media.ts +++ b/frontend/application/lib/media.ts @@ -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}`; }