Skip to content

Commit

Permalink
activities and trains api
Browse files Browse the repository at this point in the history
  • Loading branch information
AchyuthMohan committed Dec 4, 2022
1 parent 747a9e9 commit 251b6cb
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/pages/Dashboard/Dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const Dashboard = () => {
console.log(response)
response.data.forEach((item)=>{
if(item.user_foreign===currUserid)
{ console.log("hi")
{
setUserDetailId(item.id)
setActualname(item.actual_name)
setPhno(item.phno)
Expand Down
2 changes: 2 additions & 0 deletions src/pages/Login/Login.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ const Login = () => {
if(res.status===200)

navigate('/')
},(error)=>{

})

}
Expand Down
13 changes: 7 additions & 6 deletions src/pages/PlaceDetailPage/PlaceDetailPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const PlaceDetailPage = () => {
const[travelId,setTravelId]=useState(0)
const[things,setThings]=useState([])
const[flights,setFlights]=useState([])
const[hotel,setHotel]=useState([])
const[hotels,setHotels]=useState([])
useEffect(()=>{
axios.get(`${baseUrl}/flights/`).then((response)=>{
setFlights(response.data)
Expand Down Expand Up @@ -46,7 +46,7 @@ const PlaceDetailPage = () => {

useEffect(()=>{
axios.get(`${baseUrl}/hotels/`).then((response)=>{
setHotel(response.data)
setHotels(response.data)
})
},[])
const nextFrame=()=>{
Expand Down Expand Up @@ -120,12 +120,13 @@ const PlaceDetailPage = () => {

<div className="place__header_name">Hotels in {placeName}
<ul>
{hotel.map((hotels)=>
{hotels.map((hotel)=>
hotel.place_foreign===parseInt(id)?
(<li className='flight_details'>
<p>Hotel Name: {hotels.hotel_name}</p>
<p>Train Time: {hotels.near_point}</p>
<p>Cost: {hotels.famous_foods}</p>
<img src={hotel.hotel_image} alt="" style={{width:'5rem',height:'5rem'}}/>
<p>Hotel Name: {hotel.hotel_name}</p>
<p>Near Point: {hotel.near_point}</p>
<p>Famous Foods: {hotel.famous_foods}</p>

</li>
):null
Expand Down

0 comments on commit 251b6cb

Please sign in to comment.