Ignore:
Timestamp:
05/02/25 00:37:10 (2 weeks ago)
Author:
Aleksandar Panovski <apano77@…>
Branches:
main
Children:
c44c5ed
Parents:
e15e8d9
Message:

Added menu tag

succesfull testing and implemnation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • my-react-app/src/components/RestaurantContext.js

    re15e8d9 r2518b3a  
    88
    99    useEffect(() => {
     10        if (restaurants.length > 0) return;
    1011        const fetchRestaurants = async () => {
    1112            try {
    1213                const response = await axios.get('http://localhost:8081/api/restaurants');
     14                console.log("Fetched once", response.data);
    1315                setRestaurants(response.data);
    1416            } catch (error) {
     
    1618            }
    1719        };
    18 
    1920        fetchRestaurants();
    2021    }, []);
Note: See TracChangeset for help on using the changeset viewer.