Unrated orders error fixed

This commit is contained in:
Sidharth Prabhu
2026-08-04 14:21:14 +05:30
parent f898adff22
commit 5fa3a57e84
8 changed files with 30 additions and 17 deletions

View File

@@ -6,6 +6,7 @@ import CartTab from '../components/CartTab';
import BottomNav from '../components/BottomNav';
import type { Stall } from '../types';
import './StallDetailScreen.css';
import { getApiBaseUrl } from '../utils/api';
const StallDetailScreen: React.FC = () => {
const { id } = useParams<{ id: string }>();
@@ -18,7 +19,7 @@ const StallDetailScreen: React.FC = () => {
const fetchStallDetails = async () => {
setLoading(true);
try {
const response = await fetch(`http://${window.location.hostname}:8080/api/stalls/${id}`);
const response = await fetch(`${getApiBaseUrl()}/api/stalls/${id}`);
if (!response.ok) throw new Error('Stall not found');
const data = await response.json();
@@ -61,8 +62,7 @@ const StallDetailScreen: React.FC = () => {
fetchStallDetails();
// SSE Real-time stock updates
const host = window.location.hostname;
const eventSource = new EventSource(`http://${host}:8080/api/stock/stream`);
const eventSource = new EventSource(`${getApiBaseUrl()}/api/stock/stream`);
eventSource.addEventListener('stockUpdate', (event: any) => {
try {