Remove comments
This commit is contained in:
@@ -3,7 +3,6 @@
|
||||
import { LeadCard } from './components/LeadCard';
|
||||
import { useState, useEffect } from 'react';
|
||||
|
||||
// Define the shape of your lead for better type safety
|
||||
interface Lead {
|
||||
id: string;
|
||||
name: string;
|
||||
@@ -17,11 +16,9 @@ export default function Home() {
|
||||
useEffect(() => {
|
||||
const fetchLeads = async () => {
|
||||
try {
|
||||
// Use the environment variable or hardcoded backend URL
|
||||
const res = await fetch(`${process.env.NEXT_PUBLIC_API_URL || 'http://localhost:3000'}/leads`);
|
||||
const data = await res.json();
|
||||
|
||||
// Assuming your NestJS/Python returns { leads: [...] }
|
||||
setLeads(data.leads);
|
||||
} catch (error) {
|
||||
console.error("Failed to fetch leads:", error);
|
||||
|
||||
Reference in New Issue
Block a user