chanded api names

This commit is contained in:
Jelaletdin12
2026-03-27 23:01:33 +05:00
parent 7dc9a5fbc7
commit 7c75205077
5 changed files with 10 additions and 3637 deletions

View File

@@ -106,7 +106,7 @@ export default function CarConfigurator() {
// Load data.json — served from /public/data.json, readable by all users
useEffect(() => {
fetch("/api/data")
fetch("/frontend-api/data")
.then((r) => r.json())
.then((data) => {
setAppData(data);

View File

@@ -66,7 +66,7 @@ function AdminPanel({ onLogout }) {
// Load data.json from /public
useEffect(() => {
fetch("api/data")
fetch("/frontend-api/data")
.then((r) => r.json())
.then((d) => {
setData(d);
@@ -159,7 +159,7 @@ function AdminPanel({ onLogout }) {
// ── Save = download updated data.json ──────────────────────
// Since there's no backend, admin downloads the JSON and replaces public/data.json
async function handleSave() {
const res = await fetch("/api/data", {
const res = await fetch("/frontend-api/data", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify(data),