Add API_BASE and fix URLs in LeadForm.tsx
cgen-7314d290d8924b52977e531c0c3fbb6d
This commit is contained in:
parent
6a10ca27ee
commit
a0a321e6eb
2 changed files with 6 additions and 2 deletions
|
|
@ -1,4 +1,6 @@
|
|||
import { useEffect, useState } from "react";
|
||||
|
||||
const API_BASE = import.meta.env.VITE_API_BASE || "";
|
||||
import {
|
||||
Card,
|
||||
CardContent,
|
||||
|
|
@ -25,7 +27,7 @@ export default function FeaturedStudiosGrid() {
|
|||
(async () => {
|
||||
setLoading(true);
|
||||
try {
|
||||
const res = await fetch("/api/featured-studios");
|
||||
const res = await fetch(`${API_BASE}/api/featured-studios`);
|
||||
const data = res.ok ? await res.json() : [];
|
||||
setStudios(Array.isArray(data) ? data : []);
|
||||
} catch {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,6 @@
|
|||
import { useEffect, useMemo, useState } from "react";
|
||||
|
||||
const API_BASE = import.meta.env.VITE_API_BASE || "";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import {
|
||||
Card,
|
||||
|
|
@ -55,7 +57,7 @@ export default function LeadForm() {
|
|||
}
|
||||
setLoading(true);
|
||||
try {
|
||||
const r = await fetch("/api/leads", {
|
||||
const r = await fetch(`${API_BASE}/api/leads`, {
|
||||
method: "POST",
|
||||
headers: { "content-type": "application/json" },
|
||||
body: JSON.stringify(form),
|
||||
|
|
|
|||
Loading…
Reference in a new issue