Changeset ac19a0c for frontend/src/Components/Resources/ResourcesTab.js
- Timestamp:
- 01/13/24 23:19:50 (9 months ago)
- Branches:
- master
- Children:
- e85a562
- Parents:
- e9b4ba9
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
frontend/src/Components/Resources/ResourcesTab.js
re9b4ba9 rac19a0c 11 11 function ResourcesTab(props) { 12 12 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; 15 14 const { data, setData, isLoading, getData, setChanged } = useGet(`${props.tab}/user/${userId}`); 16 15 17 16 const handleSelect = (eventKey) => { 18 17 setActiveTab(eventKey); 19 console.log(props.refresh);20 18 props.refresh(eventKey); 21 console.log("refresh" + eventKey);22 19 }; 23 24 !isLoading && console.log(data);25 console.log(props.tab);26 20 27 21 return ( … … 78 72 data.map((hotel) => { 79 73 return ( 80 <Link key={hotel.hotelId} to={"/resources/hotel/" + hotel.hotelId}>74 <Link style={{textDecoration: "none"}} key={hotel.hotelId} to={"/resources/hotel/" + hotel.hotelId}> 81 75 <ResourceListing 82 76 key={hotel.hotelId} … … 93 87 {props.tab == "/restaurant" && !isLoading && data != null && 94 88 data.map((restaurant) => { 95 console.log("mapiranje " + restaurant)96 89 return ( 97 <Link key={restaurant.restaurantId} to={"/resources/restaurant/" + restaurant.restaurantID}>98 90 <ResourceListing 99 key={restaurant.restaurantI d}91 key={restaurant.restaurantID} 100 92 type="restaurant" 101 93 data={restaurant} 102 /> 103 </Link> 104 ); 94 />); 105 95 })} 106 96 <AddNew type="restaurant" refresh={setChanged}/>
Note:
See TracChangeset
for help on using the changeset viewer.