phase 3 21 openticket.artifitial.ru

This commit is contained in:
2026-03-10 11:18:56 +00:00
parent c5efaaa5b3
commit 0e08e08fe1
2 changed files with 6 additions and 4 deletions

View File

@@ -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" },
});

View File

@@ -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 ───────────────────────────────────────────────────