Ignore:
Timestamp:
01/13/24 23:19:50 (9 months ago)
Author:
darsov2 <62809499+darsov2@…>
Branches:
master
Children:
e85a562
Parents:
e9b4ba9
Message:

authContext impl, admin panel impl, search bar fixes, reservations listings impl

File:
1 edited

Legend:

Unmodified
Added
Removed
  • frontend/src/Components/Resources/ResourcesTab.js

    re9b4ba9 rac19a0c  
    1111function ResourcesTab(props) {
    1212  const [activeTab, setActiveTab] = useState(props.tab);
    13   // const [changed, setChanged] = useState(0);
    14   const userId = localStorage.getItem("userId");
     13  const userId = JSON.parse(localStorage.getItem("user")).userId;
    1514  const { data, setData, isLoading, getData, setChanged } = useGet(`${props.tab}/user/${userId}`);
    1615
    1716  const handleSelect = (eventKey) => {
    1817    setActiveTab(eventKey);
    19     console.log(props.refresh);
    2018    props.refresh(eventKey);
    21     console.log("refresh" + eventKey);
    2219  };
    23 
    24   !isLoading && console.log(data);
    25   console.log(props.tab);
    2620
    2721  return (
     
    7872              data.map((hotel) => {
    7973                return (
    80                   <Link key={hotel.hotelId} to={"/resources/hotel/" + hotel.hotelId}>
     74                  <Link style={{textDecoration: "none"}} key={hotel.hotelId} to={"/resources/hotel/" + hotel.hotelId}>
    8175                    <ResourceListing
    8276                      key={hotel.hotelId}
     
    9387            {props.tab == "/restaurant" && !isLoading && data != null &&
    9488              data.map((restaurant) => {
    95                 console.log("mapiranje " + restaurant)
    9689                return (
    97                   <Link key={restaurant.restaurantId} to={"/resources/restaurant/" + restaurant.restaurantID}>
    9890                    <ResourceListing
    99                       key={restaurant.restaurantId}
     91                      key={restaurant.restaurantID}
    10092                      type="restaurant"
    10193                      data={restaurant}
    102                     />
    103                   </Link>
    104                 );
     94                    />);
    10595              })}
    10696            <AddNew type="restaurant" refresh={setChanged}/>
Note: See TracChangeset for help on using the changeset viewer.