diff --git a/frontend-client/src/api/client.ts b/frontend-client/src/api/client.ts index 217c3a0..3baaf28 100644 --- a/frontend-client/src/api/client.ts +++ b/frontend-client/src/api/client.ts @@ -1,8 +1,10 @@ import axios from "axios"; import { useAuthStore } from "@/store/authStore"; +const BASE_URL = "/api"; + const apiClient = axios.create({ - baseURL: process.env.NEXT_PUBLIC_API_URL ?? "http://localhost:8000/api", + baseURL: BASE_URL, headers: { "Content-Type": "application/json" }, }); diff --git a/frontend-client/src/app/tickets/[id]/page.tsx b/frontend-client/src/app/tickets/[id]/page.tsx index 926a68f..e56280d 100644 --- a/frontend-client/src/app/tickets/[id]/page.tsx +++ b/frontend-client/src/app/tickets/[id]/page.tsx @@ -9,9 +9,9 @@ import { getMyTicketsApi, type TicketResponse } from "@/api/client"; // ─── Constants ──────────────────────────────────────────────────────────────── -/** Replace internal MinIO hostname with the externally accessible address */ +/** Strip the internal MinIO origin so the URL becomes a relative path. + * e.g. "http://minio:9000/tickets-media/file.pdf" → "/tickets-media/file.pdf" */ const MINIO_INTERNAL = "http://minio:9000"; -const MINIO_EXTERNAL = process.env.NEXT_PUBLIC_MINIO_URL ?? "http://localhost:9000"; const RU_MONTHS = [ "Января", "Февраля", "Марта", "Апреля", "Мая", "Июня", @@ -26,7 +26,7 @@ function formatDate(iso: string): string { } function resolvePdfUrl(url: string): string { - return url.replace(MINIO_INTERNAL, MINIO_EXTERNAL); + return url.replace(MINIO_INTERNAL, ""); } // ─── Perforated ticket card ───────────────────────────────────────────────────