componentDidMount() {
		var tempOptions = []
		axios.get("http://localhost:8082/itinerary")
			.then(response => {
				console.log(response)
				let res = response.data
				const allItineries = res.filter(val => val.id !== "").map(item => {
					console.log("item", item.id)
					return { value: item.id, label: item.id }
				})

				this.setState({ options: allItineries })
				this.setState({ itineries: response.data })
				console.log("item2", this.state.options)
			})
			.catch(error => {
				console.log(error)
			})


		console.log(this.state.options)
	}
// React lifecycle method load existing itineraries
React lifecycle method load existing itineraries
React lifecycle method load existing itineraries
componentDidMount() {
		var tempOptions = []
		axios.get("http://localhost:8082/itinerary")
			.then(response => {
				console.log(response)
				let res = response.data
				const allItineries = res.filter(val => val.id !== "").map(item => {
					console.log("item", item.id)
					return { value: item.id, label: item.id }
				})
				this.setState({ options: allItineries })
				this.setState({ itineries: response.data })
				console.log("item2", this.state.options)
			})
			.catch(error => {
				console.log(error)
			})
		console.log(this.state.options)
	}
componentDidMount ( ) { var tempOptions = [ ] axios . get ( "http://localhost:8082/itinerary" ) . then ( response => { console . log ( response ) let res = response . data const allItineries = res . filter ( val => val . id !== "" ) . map ( item => { console . log ( "item" , item . id ) return { value : item . id , label : item . id } } ) this . setState ( { options : allItineries } ) this . setState ( { itineries : response . data } ) console . log ( "item2" , this . state . options ) } ) . catch ( error => { console . log ( error ) } ) console . log ( this . state . options ) }
React lifecycle method load existing itineraries
React lifecycle method load existing itineraries