mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-30 07:38:10 +00:00
Deployment issues fix
This commit is contained in:
@@ -1,53 +0,0 @@
|
|||||||
import {
|
|
||||||
useNavigate,
|
|
||||||
useLocation,
|
|
||||||
Routes,
|
|
||||||
Route,
|
|
||||||
Navigate,
|
|
||||||
} from "react-router-dom";
|
|
||||||
import { DashboardLayout, type SidebarItem } from "@edr/ui-common";
|
|
||||||
|
|
||||||
import TicketsPage from "./pages/tickets/TicketsPage";
|
|
||||||
import TicketDetailPage from "./pages/tickets/TicketDetailPage";
|
|
||||||
import BookTicketPage from "./pages/tickets/BookTicketPage";
|
|
||||||
import SchedulesPage from "./pages/schedules/SchedulesPage";
|
|
||||||
import ScheduleDetailPage from "./pages/schedules/ScheduleDetailPage";
|
|
||||||
import StationsPage from "./pages/stations/StationsPage";
|
|
||||||
import PassengersPage from "./pages/passengers/PassengersPage";
|
|
||||||
import DashboardPage from "./pages/dashboard/DashboardPage";
|
|
||||||
|
|
||||||
const sidebarItems: SidebarItem[] = [
|
|
||||||
{ label: "Dashboard", href: "/" },
|
|
||||||
{ label: "Tickets", href: "/tickets" },
|
|
||||||
{ label: "Schedules", href: "/schedules" },
|
|
||||||
{ label: "Stations", href: "/stations" },
|
|
||||||
{ label: "Passengers", href: "/passengers" },
|
|
||||||
];
|
|
||||||
|
|
||||||
const App = () => {
|
|
||||||
const navigate = useNavigate();
|
|
||||||
const location = useLocation();
|
|
||||||
|
|
||||||
return (
|
|
||||||
<DashboardLayout
|
|
||||||
title="EDR Passenger"
|
|
||||||
sidebarItems={sidebarItems}
|
|
||||||
activeHref={location.pathname}
|
|
||||||
onNavigate={navigate}
|
|
||||||
>
|
|
||||||
<Routes>
|
|
||||||
<Route path="/" element={<DashboardPage />} />
|
|
||||||
<Route path="/tickets" element={<TicketsPage />} />
|
|
||||||
<Route path="/tickets/new" element={<BookTicketPage />} />
|
|
||||||
<Route path="/tickets/:id" element={<TicketDetailPage />} />
|
|
||||||
<Route path="/schedules" element={<SchedulesPage />} />
|
|
||||||
<Route path="/schedules/:id" element={<ScheduleDetailPage />} />
|
|
||||||
<Route path="/stations" element={<StationsPage />} />
|
|
||||||
<Route path="/passengers" element={<PassengersPage />} />
|
|
||||||
<Route path="*" element={<Navigate to="/" replace />} />
|
|
||||||
</Routes>
|
|
||||||
</DashboardLayout>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
export default App;
|
|
||||||
@@ -18,7 +18,7 @@ export default function ConfirmationPage() {
|
|||||||
mutationFn: () => apiClient.patch(`/bookings/${bookingId}/confirm`, { status: 'SUCCEEDED' }),
|
mutationFn: () => apiClient.patch(`/bookings/${bookingId}/confirm`, { status: 'SUCCEEDED' }),
|
||||||
});
|
});
|
||||||
|
|
||||||
const { data: booking } = useQuery({
|
const { data: _booking } = useQuery({
|
||||||
queryKey: ['booking', bookingId],
|
queryKey: ['booking', bookingId],
|
||||||
queryFn: async () => {
|
queryFn: async () => {
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ type FormData = z.infer<typeof formSchema>;
|
|||||||
export default function PassengersPage() {
|
export default function PassengersPage() {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const { searchCriteria, setPassengers, setCreateAccount } = useBookingStore();
|
const { searchCriteria, setPassengers, setCreateAccount } = useBookingStore();
|
||||||
const { user, isAuthenticated, logout, updateUser } = useAuthStore();
|
const { user, isAuthenticated, updateUser } = useAuthStore();
|
||||||
const [faydaEnabled, setFaydaEnabled] = useState(true);
|
const [faydaEnabled, setFaydaEnabled] = useState(true);
|
||||||
const [verificationStatus, setVerificationStatus] = useState<Record<number, 'success' | 'error'>>({});
|
const [verificationStatus, setVerificationStatus] = useState<Record<number, 'success' | 'error'>>({});
|
||||||
const [updatingUser, setUpdatingUser] = useState(false);
|
const [updatingUser, setUpdatingUser] = useState(false);
|
||||||
@@ -59,7 +59,7 @@ export default function PassengersPage() {
|
|||||||
const { register, control, handleSubmit, setValue, watch, formState: { errors } } = useForm<FormData>({
|
const { register, control, handleSubmit, setValue, watch, formState: { errors } } = useForm<FormData>({
|
||||||
resolver: zodResolver(formSchema),
|
resolver: zodResolver(formSchema),
|
||||||
defaultValues: {
|
defaultValues: {
|
||||||
passengers: Array.from({ length: totalPassengers }, (_, i) => ({
|
passengers: Array.from({ length: totalPassengers }, () => ({
|
||||||
name: '',
|
name: '',
|
||||||
dateOfBirth: '',
|
dateOfBirth: '',
|
||||||
gender: undefined,
|
gender: undefined,
|
||||||
|
|||||||
@@ -39,9 +39,9 @@ export default function ResultsPage() {
|
|||||||
|
|
||||||
const { data: results, isLoading, error } = useQuery<Schedule[]>({
|
const { data: results, isLoading, error } = useQuery<Schedule[]>({
|
||||||
queryKey: ['search', searchData],
|
queryKey: ['search', searchData],
|
||||||
queryFn: async () => {
|
queryFn: async (): Promise<Schedule[]> => {
|
||||||
console.log('Searching with criteria:', searchData);
|
console.log('Searching with criteria:', searchData);
|
||||||
const response = await apiClient.post('/search', searchData);
|
const response = await apiClient.post('/search', searchData) as Schedule[];
|
||||||
console.log('Search results:', response);
|
console.log('Search results:', response);
|
||||||
console.log('Number of results:', response?.length || 0);
|
console.log('Number of results:', response?.length || 0);
|
||||||
return response;
|
return response;
|
||||||
@@ -90,8 +90,8 @@ export default function ResultsPage() {
|
|||||||
trainNumber: schedule.trainNumber,
|
trainNumber: schedule.trainNumber,
|
||||||
origin: schedule.origin?.name || 'Origin',
|
origin: schedule.origin?.name || 'Origin',
|
||||||
destination: schedule.destination?.name || 'Destination',
|
destination: schedule.destination?.name || 'Destination',
|
||||||
departureTime: schedule.departureAt || schedule.departureTime,
|
departureTime: schedule.departureAt || schedule.departureTime || '',
|
||||||
arrivalTime: schedule.arrivalAt || schedule.arrivalTime,
|
arrivalTime: schedule.arrivalAt || schedule.arrivalTime || '',
|
||||||
duration: durationStr,
|
duration: durationStr,
|
||||||
baseFareAdult: selectedClassFare.baseFareMinor,
|
baseFareAdult: selectedClassFare.baseFareMinor,
|
||||||
baseFareChild: selectedClassFare.baseFareMinor,
|
baseFareChild: selectedClassFare.baseFareMinor,
|
||||||
@@ -140,7 +140,7 @@ export default function ResultsPage() {
|
|||||||
</div>
|
</div>
|
||||||
<h2 className="text-2xl font-bold mb-3 text-gray-900 dark:text-gray-100">No Trains Found</h2>
|
<h2 className="text-2xl font-bold mb-3 text-gray-900 dark:text-gray-100">No Trains Found</h2>
|
||||||
<p className="text-gray-600 dark:text-gray-400 mb-8">
|
<p className="text-gray-600 dark:text-gray-400 mb-8">
|
||||||
We couldn't find any trains matching your search criteria. Try adjusting your dates or route.
|
We couldn't find any trains matching your search criteria. Try adjusting your dates or route.
|
||||||
</p>
|
</p>
|
||||||
<button onClick={() => router.push(buildSearchUrl())} className="btn-primary">
|
<button onClick={() => router.push(buildSearchUrl())} className="btn-primary">
|
||||||
Modify Search
|
Modify Search
|
||||||
|
|||||||
@@ -209,9 +209,8 @@ export default function ReviewPage() {
|
|||||||
const baseFare = passengers.reduce((sum, p, i) => {
|
const baseFare = passengers.reduce((sum, p, i) => {
|
||||||
// Get the fare per passenger from the schedule
|
// Get the fare per passenger from the schedule
|
||||||
const farePerPassenger = selectedSchedule.baseFareAdult ||
|
const farePerPassenger = selectedSchedule.baseFareAdult ||
|
||||||
selectedSchedule.baseFare ||
|
(selectedSchedule as any).fareAdult ||
|
||||||
selectedSchedule.fareAdult ||
|
(selectedSchedule as any).price ||
|
||||||
selectedSchedule.price ||
|
|
||||||
0;
|
0;
|
||||||
|
|
||||||
console.log(`Passenger ${i}: ${p.name}, fare = ${farePerPassenger}`);
|
console.log(`Passenger ${i}: ${p.name}, fare = ${farePerPassenger}`);
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import { useQuery } from '@tanstack/react-query';
|
|||||||
import { apiClient } from '@/lib/api-client';
|
import { apiClient } from '@/lib/api-client';
|
||||||
import { useBookingStore } from '@/lib/booking-store';
|
import { useBookingStore } from '@/lib/booking-store';
|
||||||
import { Station } from '@/types';
|
import { Station } from '@/types';
|
||||||
import { Train, MapPin, Calendar, Users, ArrowRight, ArrowLeftRight, Plus, Minus, Search } from 'lucide-react';
|
import { Train, MapPin, Calendar, ArrowRight, ArrowLeftRight, Plus, Minus, Search } from 'lucide-react';
|
||||||
import { useEffect } from 'react';
|
import { useEffect } from 'react';
|
||||||
import ModernDatePicker from '@/components/ModernDatePicker';
|
import ModernDatePicker from '@/components/ModernDatePicker';
|
||||||
|
|
||||||
@@ -33,8 +33,8 @@ export default function SearchPage() {
|
|||||||
|
|
||||||
const { data: stations, isLoading, error } = useQuery<Station[]>({
|
const { data: stations, isLoading, error } = useQuery<Station[]>({
|
||||||
queryKey: ['stations'],
|
queryKey: ['stations'],
|
||||||
queryFn: async () => {
|
queryFn: async (): Promise<Station[]> => {
|
||||||
const response = await apiClient.get('/stations');
|
const response = await apiClient.get('/stations') as Station[];
|
||||||
return response;
|
return response;
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import { useBookingStore } from '@/lib/booking-store';
|
|||||||
import { useQuery, useMutation } from '@tanstack/react-query';
|
import { useQuery, useMutation } from '@tanstack/react-query';
|
||||||
import { apiClient } from '@/lib/api-client';
|
import { apiClient } from '@/lib/api-client';
|
||||||
import { useState, useEffect } from 'react';
|
import { useState, useEffect } from 'react';
|
||||||
import { Seat, Coach } from '@/types';
|
|
||||||
import CustomModal from '@/components/CustomModal';
|
import CustomModal from '@/components/CustomModal';
|
||||||
|
|
||||||
export default function SeatsPage() {
|
export default function SeatsPage() {
|
||||||
@@ -13,7 +13,7 @@ export default function SeatsPage() {
|
|||||||
const { selectedSchedule, passengers, setSeatHold, setPassengers, searchCriteria } = useBookingStore();
|
const { selectedSchedule, passengers, setSeatHold, setPassengers, searchCriteria } = useBookingStore();
|
||||||
const [selectedSeats, setSelectedSeats] = useState<string[]>([]);
|
const [selectedSeats, setSelectedSeats] = useState<string[]>([]);
|
||||||
const [selectedCoach, setSelectedCoach] = useState<string | null>(null);
|
const [selectedCoach, setSelectedCoach] = useState<string | null>(null);
|
||||||
const [timeLeft, setTimeLeft] = useState<number | null>(null);
|
const [_timeLeft, _setTimeLeft] = useState<number | null>(null);
|
||||||
const [modalState, setModalState] = useState({
|
const [modalState, setModalState] = useState({
|
||||||
isOpen: false,
|
isOpen: false,
|
||||||
title: '',
|
title: '',
|
||||||
@@ -32,14 +32,14 @@ export default function SeatsPage() {
|
|||||||
if (seatMapData) {
|
if (seatMapData) {
|
||||||
console.log('Seat map data:', seatMapData);
|
console.log('Seat map data:', seatMapData);
|
||||||
console.log('Is array?', Array.isArray(seatMapData));
|
console.log('Is array?', Array.isArray(seatMapData));
|
||||||
console.log('Has coaches?', seatMapData?.coaches);
|
console.log('Has coaches?', (seatMapData as any)?.coaches);
|
||||||
}
|
}
|
||||||
}, [seatMapData]);
|
}, [seatMapData]);
|
||||||
|
|
||||||
const holdMutation = useMutation({
|
const holdMutation = useMutation({
|
||||||
mutationFn: async (seatIds: string[]) => {
|
mutationFn: async (seatIds: string[]) => {
|
||||||
// Create temporary passenger IDs for the hold
|
// Create temporary passenger IDs for the hold
|
||||||
const passengersForHold = passengers.slice(0, seatIds.length).map((p, i) => ({
|
const passengersForHold = passengers.slice(0, seatIds.length).map((_, i) => ({
|
||||||
passengerId: `temp-${Date.now()}-${i}`, // Temporary ID for guest booking
|
passengerId: `temp-${Date.now()}-${i}`, // Temporary ID for guest booking
|
||||||
seatId: seatIds[i],
|
seatId: seatIds[i],
|
||||||
}));
|
}));
|
||||||
@@ -60,7 +60,7 @@ export default function SeatsPage() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Extract coaches and seats from seat map data
|
// Extract coaches and seats from seat map data
|
||||||
const coaches = seatMapData?.coaches || [];
|
const coaches = (seatMapData as any)?.coaches || [];
|
||||||
|
|
||||||
// Debug: Log coaches
|
// Debug: Log coaches
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@@ -80,8 +80,8 @@ export default function SeatsPage() {
|
|||||||
const seatClassName = typeof c.seatClass === 'string' ? c.seatClass : (c.seatClass?.name || c.coachClass || '');
|
const seatClassName = typeof c.seatClass === 'string' ? c.seatClass : (c.seatClass?.name || c.coachClass || '');
|
||||||
console.log('Comparing:', seatClassName, 'with', selectedSchedule.selectedSeatClass);
|
console.log('Comparing:', seatClassName, 'with', selectedSchedule.selectedSeatClass);
|
||||||
return seatClassName === selectedSchedule.selectedSeatClass ||
|
return seatClassName === selectedSchedule.selectedSeatClass ||
|
||||||
seatClassName.replace(/_/g, ' ').toLowerCase() === selectedSchedule.selectedSeatClass.toLowerCase() ||
|
seatClassName.replace(/_/g, ' ').toLowerCase() === selectedSchedule.selectedSeatClass?.toLowerCase() ||
|
||||||
seatClassName.toLowerCase() === selectedSchedule.selectedSeatClass.toLowerCase();
|
seatClassName.toLowerCase() === selectedSchedule.selectedSeatClass?.toLowerCase();
|
||||||
})
|
})
|
||||||
: coaches;
|
: coaches;
|
||||||
|
|
||||||
|
|||||||
@@ -95,7 +95,7 @@ export default function HowToGuidePage() {
|
|||||||
<div className="bg-gray-50 dark:bg-gray-800 p-4 rounded-lg space-y-3">
|
<div className="bg-gray-50 dark:bg-gray-800 p-4 rounded-lg space-y-3">
|
||||||
<div>
|
<div>
|
||||||
<p className="text-sm font-semibold text-gray-900 dark:text-gray-100 mb-1">For Ethiopian Citizens:</p>
|
<p className="text-sm font-semibold text-gray-900 dark:text-gray-100 mb-1">For Ethiopian Citizens:</p>
|
||||||
<p className="text-sm text-gray-700 dark:text-gray-300">Click "Verify with Fayda" to auto-fill your details using your national ID.</p>
|
<p className="text-sm text-gray-700 dark:text-gray-300">Click "Verify with Fayda" to auto-fill your details using your national ID.</p>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<p className="text-sm font-semibold text-gray-900 dark:text-gray-100 mb-1">For International Travelers:</p>
|
<p className="text-sm font-semibold text-gray-900 dark:text-gray-100 mb-1">For International Travelers:</p>
|
||||||
|
|||||||
@@ -5,9 +5,9 @@ import { useRouter } from 'next/navigation';
|
|||||||
import { useAuthStore } from '@/lib/auth-store';
|
import { useAuthStore } from '@/lib/auth-store';
|
||||||
import { useTheme } from '@/components/ThemeProvider';
|
import { useTheme } from '@/components/ThemeProvider';
|
||||||
import {
|
import {
|
||||||
User, Settings, Ticket, ChevronRight, Calendar, MapPin,
|
User, Settings, Ticket, Calendar, MapPin,
|
||||||
Download, Trash2, Lock, Bell, CreditCard, Globe,
|
Download, Trash2, Lock, Bell, CreditCard,
|
||||||
MapPinned, Palette, CheckCircle, XCircle, Clock,
|
MapPinned, Palette, CheckCircle,
|
||||||
Eye, Edit, LogOut, X
|
Eye, Edit, LogOut, X
|
||||||
} from 'lucide-react';
|
} from 'lucide-react';
|
||||||
import { apiClient } from '@/lib/api-client';
|
import { apiClient } from '@/lib/api-client';
|
||||||
@@ -99,7 +99,7 @@ export default function ProfilePage() {
|
|||||||
const updateProfileMutation = useMutation({
|
const updateProfileMutation = useMutation({
|
||||||
mutationFn: (data: any) => apiClient.patch('/auth/profile', data),
|
mutationFn: (data: any) => apiClient.patch('/auth/profile', data),
|
||||||
onSuccess: (response) => {
|
onSuccess: (response) => {
|
||||||
const updatedData = response.data || response;
|
const updatedData = (response as any).data || response;
|
||||||
updateUser(updatedData);
|
updateUser(updatedData);
|
||||||
setShowEditProfile(false);
|
setShowEditProfile(false);
|
||||||
setModalConfig({
|
setModalConfig({
|
||||||
@@ -331,7 +331,7 @@ export default function ProfilePage() {
|
|||||||
<div className="animate-spin rounded-full h-12 w-12 border-b-2 border-primary mx-auto"></div>
|
<div className="animate-spin rounded-full h-12 w-12 border-b-2 border-primary mx-auto"></div>
|
||||||
<p className="text-gray-600 dark:text-gray-400 mt-4">Loading bookings...</p>
|
<p className="text-gray-600 dark:text-gray-400 mt-4">Loading bookings...</p>
|
||||||
</div>
|
</div>
|
||||||
) : bookings && bookings.length > 0 ? (
|
) : bookings && Array.isArray(bookings) && bookings.length > 0 ? (
|
||||||
bookings.map((booking: Booking) => (
|
bookings.map((booking: Booking) => (
|
||||||
<div key={booking.id} className="card hover:shadow-lg transition-shadow">
|
<div key={booking.id} className="card hover:shadow-lg transition-shadow">
|
||||||
<div className="flex items-center justify-between">
|
<div className="flex items-center justify-between">
|
||||||
|
|||||||
@@ -1,15 +1,13 @@
|
|||||||
'use client';
|
'use client';
|
||||||
|
|
||||||
import { Train, LogOut, User, BookOpen, LogIn } from 'lucide-react';
|
import { Train, User, BookOpen, LogIn } from 'lucide-react';
|
||||||
import ThemeToggle from './ThemeToggle';
|
import ThemeToggle from './ThemeToggle';
|
||||||
import Link from 'next/link';
|
import Link from 'next/link';
|
||||||
import { useAuthStore } from '@/lib/auth-store';
|
import { useAuthStore } from '@/lib/auth-store';
|
||||||
import { useRouter } from 'next/navigation';
|
|
||||||
import { useEffect } from 'react';
|
import { useEffect } from 'react';
|
||||||
|
|
||||||
export default function AppHeader() {
|
export default function AppHeader() {
|
||||||
const { user, isAuthenticated, initialize } = useAuthStore();
|
const { user, isAuthenticated, initialize } = useAuthStore();
|
||||||
const router = useRouter();
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
initialize();
|
initialize();
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ export default function DualCalendarPicker({
|
|||||||
}: DualCalendarPickerProps) {
|
}: DualCalendarPickerProps) {
|
||||||
const [isOpen, setIsOpen] = useState(false);
|
const [isOpen, setIsOpen] = useState(false);
|
||||||
const [calendarType, setCalendarType] = useState<'gregorian' | 'ethiopian'>('gregorian');
|
const [calendarType, setCalendarType] = useState<'gregorian' | 'ethiopian'>('gregorian');
|
||||||
const [currentDate, setCurrentDate] = useState(value || new Date());
|
const [_currentDate, setCurrentDate] = useState(value || new Date());
|
||||||
const [viewMonth, setViewMonth] = useState(value?.getMonth() || new Date().getMonth());
|
const [viewMonth, setViewMonth] = useState(value?.getMonth() || new Date().getMonth());
|
||||||
const [viewYear, setViewYear] = useState(value?.getFullYear() || new Date().getFullYear());
|
const [viewYear, setViewYear] = useState(value?.getFullYear() || new Date().getFullYear());
|
||||||
|
|
||||||
|
|||||||
@@ -99,7 +99,7 @@ export function ethiopianToGregorian(ethDate: EthiopianDate): Date {
|
|||||||
/**
|
/**
|
||||||
* Get day of year from date (1-366)
|
* Get day of year from date (1-366)
|
||||||
*/
|
*/
|
||||||
function getDayOfYear(date: Date): number {
|
export function getDayOfYear(date: Date): number {
|
||||||
const start = new Date(date.getFullYear(), 0, 0);
|
const start = new Date(date.getFullYear(), 0, 0);
|
||||||
const diff = date.getTime() - start.getTime();
|
const diff = date.getTime() - start.getTime();
|
||||||
const oneDay = 1000 * 60 * 60 * 24;
|
const oneDay = 1000 * 60 * 60 * 24;
|
||||||
@@ -109,7 +109,7 @@ function getDayOfYear(date: Date): number {
|
|||||||
/**
|
/**
|
||||||
* Convert day of year to Date object
|
* Convert day of year to Date object
|
||||||
*/
|
*/
|
||||||
function dayOfYearToDate(year: number, dayOfYear: number): Date {
|
export function dayOfYearToDate(year: number, dayOfYear: number): Date {
|
||||||
const date = new Date(year, 0);
|
const date = new Date(year, 0);
|
||||||
date.setDate(dayOfYear);
|
date.setDate(dayOfYear);
|
||||||
return date;
|
return date;
|
||||||
|
|||||||
@@ -1,18 +0,0 @@
|
|||||||
import { StrictMode } from "react";
|
|
||||||
import { createRoot } from "react-dom/client";
|
|
||||||
import { BrowserRouter } from "react-router-dom";
|
|
||||||
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
|
|
||||||
|
|
||||||
import App from "./App";
|
|
||||||
|
|
||||||
const queryClient = new QueryClient();
|
|
||||||
|
|
||||||
createRoot(document.getElementById("root")!).render(
|
|
||||||
<StrictMode>
|
|
||||||
<QueryClientProvider client={queryClient}>
|
|
||||||
<BrowserRouter>
|
|
||||||
<App />
|
|
||||||
</BrowserRouter>
|
|
||||||
</QueryClientProvider>
|
|
||||||
</StrictMode>,
|
|
||||||
);
|
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
|
|
||||||
export const api = axios.create({
|
export const api = axios.create({
|
||||||
baseURL: import.meta.env.VITE_API_URL,
|
baseURL: process.env.NEXT_PUBLIC_API_URL,
|
||||||
});
|
});
|
||||||
|
|
||||||
// TODO: integrate @edr/auth — add a request interceptor here that attaches
|
// TODO: integrate @edr/auth — add a request interceptor here that attaches
|
||||||
|
|||||||
@@ -1,9 +0,0 @@
|
|||||||
/// <reference types="vite/client" />
|
|
||||||
|
|
||||||
interface ImportMetaEnv {
|
|
||||||
readonly VITE_API_URL: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface ImportMeta {
|
|
||||||
readonly env: ImportMetaEnv;
|
|
||||||
}
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
import { defineConfig } from "vite";
|
|
||||||
import react from "@vitejs/plugin-react";
|
|
||||||
|
|
||||||
export default defineConfig({
|
|
||||||
plugins: [react()],
|
|
||||||
server: {
|
|
||||||
port: 5174,
|
|
||||||
host: "0.0.0.0",
|
|
||||||
},
|
|
||||||
// test: {
|
|
||||||
// environment: "jsdom",
|
|
||||||
// globals: true,
|
|
||||||
// },
|
|
||||||
});
|
|
||||||
Reference in New Issue
Block a user