web fixes
This commit is contained in:
@@ -425,12 +425,12 @@ const canBookAppointments = user?.role === "CUSTOMER" || user?.role === "ADMIN";
|
|||||||
})
|
})
|
||||||
.then((r) => r.json())
|
.then((r) => r.json())
|
||||||
.then(setStores)
|
.then(setStores)
|
||||||
.catch(() => {});
|
.catch(() => setError("Failed to load stores."));
|
||||||
|
|
||||||
fetch(`${API_BASE}/api/v1/services?size=100`)
|
fetch(`${API_BASE}/api/v1/services?size=100`)
|
||||||
.then((r) => r.json())
|
.then((r) => r.json())
|
||||||
.then((data) => setServices(data.content ?? []))
|
.then((data) => setServices(data.content ?? []))
|
||||||
.catch(() => {});
|
.catch(() => setError("Failed to load services."));
|
||||||
|
|
||||||
fetch(`${API_BASE}/api/v1/pets?size=200&sort=id,asc&status=Available`)
|
fetch(`${API_BASE}/api/v1/pets?size=200&sort=id,asc&status=Available`)
|
||||||
.then((r) => r.json())
|
.then((r) => r.json())
|
||||||
|
|||||||
@@ -43,6 +43,9 @@ function PaymentForm({ clientSecret, totalAmount, onSuccess, onCancel }) {
|
|||||||
try {
|
try {
|
||||||
await apiCompleteCheckout(token, paymentIntentId);
|
await apiCompleteCheckout(token, paymentIntentId);
|
||||||
} catch {
|
} catch {
|
||||||
|
setPayError("Order confirmation failed. Please contact support.");
|
||||||
|
setPaying(false);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
onSuccess();
|
onSuccess();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ function ChatPage() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
catch {
|
catch {
|
||||||
//Silent fail
|
setError("Failed to load messages.");
|
||||||
}
|
}
|
||||||
}, [token]);
|
}, [token]);
|
||||||
|
|
||||||
@@ -139,7 +139,7 @@ function ChatPage() {
|
|||||||
if (open) convId = open.id;
|
if (open) convId = open.id;
|
||||||
}
|
}
|
||||||
} catch {
|
} catch {
|
||||||
//
|
setError("Failed to load conversations.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -30,8 +30,8 @@ export default function ContactPage() {
|
|||||||
<section className="info-content">
|
<section className="info-content">
|
||||||
<div className="info-card">
|
<div className="info-card">
|
||||||
<h2>General Contact</h2>
|
<h2>General Contact</h2>
|
||||||
<p>Email: support@petshop.com</p>
|
<p>Email: hello@leonspetstore.com.au</p>
|
||||||
<p>Phone: (000) 000-0000</p>
|
<p>Phone: (03) 9000 0000</p>
|
||||||
<p>Hours: Mon–Sat, 9:00 AM – 6:00 PM</p>
|
<p>Hours: Mon–Sat, 9:00 AM – 6:00 PM</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -135,6 +135,8 @@ function RegisterPage() {
|
|||||||
value={form.phone}
|
value={form.phone}
|
||||||
onChange={handleChange}
|
onChange={handleChange}
|
||||||
required
|
required
|
||||||
|
pattern="[0-9\-\+\(\) ]{7,15}"
|
||||||
|
title="Enter a valid phone number"
|
||||||
/>
|
/>
|
||||||
</label>
|
</label>
|
||||||
|
|
||||||
@@ -161,6 +163,7 @@ function RegisterPage() {
|
|||||||
value={form.confirmPassword}
|
value={form.confirmPassword}
|
||||||
onChange={handleChange}
|
onChange={handleChange}
|
||||||
required
|
required
|
||||||
|
minLength={6}
|
||||||
autoComplete="new-password"
|
autoComplete="new-password"
|
||||||
/>
|
/>
|
||||||
</label>
|
</label>
|
||||||
|
|||||||
@@ -15,14 +15,11 @@ export default function DisplayNav() {
|
|||||||
const [menuOpen, setMenuOpen] = useState(false);
|
const [menuOpen, setMenuOpen] = useState(false);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!token) return;
|
fetch("/api/v1/stores?size=100")
|
||||||
fetch("/api/v1/stores?size=100", {
|
|
||||||
headers: { Authorization: `Bearer ${token}` },
|
|
||||||
})
|
|
||||||
.then((r) => (r.ok ? r.json() : null))
|
.then((r) => (r.ok ? r.json() : null))
|
||||||
.then((data) => { if (data) setStores(data.content ?? []); })
|
.then((data) => { if (data) setStores(data.content ?? []); })
|
||||||
.catch(() => {});
|
.catch(() => {});
|
||||||
}, [token]);
|
}, []);
|
||||||
|
|
||||||
function handleLogout() {
|
function handleLogout() {
|
||||||
logout();
|
logout();
|
||||||
|
|||||||
Reference in New Issue
Block a user