From 0e08e08fe1624d239364cec4410f986ff2a9a1a1 Mon Sep 17 00:00:00 2001 From: openit Date: Tue, 10 Mar 2026 11:18:56 +0000 Subject: [PATCH] phase 3 21 openticket.artifitial.ru --- frontend-client/src/api/client.ts | 4 +++- frontend-client/src/app/tickets/[id]/page.tsx | 6 +++--- 2 files changed, 6 insertions(+), 4 deletions(-) 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 ───────────────────────────────────────────────────