phase 3 21 openticket.artifitial.ru
This commit is contained in:
@@ -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" },
|
||||
});
|
||||
|
||||
|
||||
@@ -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 ───────────────────────────────────────────────────
|
||||
|
||||
Reference in New Issue
Block a user