SHARE
TWEET

Untitled

a guest Jun 19th, 2019 63 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <select value={this.state.value} onChange={this.onInputChangeResort.bind(this)} name='clienteint' className='form-control form-control-sm col-sm-8'>
  2.                                                 <option value="0">Select ...</option>
  3.                                                 { this.state.hotels.map((hotels)=>
  4.                                                     <option key={hotels.value} value={hotels.value}>{hotels.text}</option>)
  5.                                                 }
  6.                                             </select>
  7.      
  8. roomtype(){
  9.         fetch("/api-rest/agency/rooms/"+this.state.value, {
  10.             method : 'GET',
  11.             headers: {
  12.                 'Content-Type' : 'text/plain',
  13.                 'Authorization': "Bearer admin"
  14.             }
  15.             })
  16.             .then((response) => response.json())
  17.             .then((responseJson) => {
  18.                 let data = responseJson.data.map(rooms => {return {value:rooms.room_type_category, text:rooms.room_category_desc}});
  19.                 this.setState({
  20.                     room : data,
  21.                 })
  22.             })
  23.  
  24.             .catch((error) => {
  25.                 console.error(error);
  26.             });
  27.     }
  28.      
  29. onInputChangeResort(e){
  30.         this.setState({value:e.target.value});
  31.     }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top