Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <select value={this.state.value} onChange={this.onInputChangeResort.bind(this)} name='clienteint' className='form-control form-control-sm col-sm-8'>
- <option value="0">Select ...</option>
- { this.state.hotels.map((hotels)=>
- <option key={hotels.value} value={hotels.value}>{hotels.text}</option>)
- }
- </select>
- roomtype(){
- fetch("/api-rest/agency/rooms/"+this.state.value, {
- method : 'GET',
- headers: {
- 'Content-Type' : 'text/plain',
- 'Authorization': "Bearer admin"
- }
- })
- .then((response) => response.json())
- .then((responseJson) => {
- let data = responseJson.data.map(rooms => {return {value:rooms.room_type_category, text:rooms.room_category_desc}});
- this.setState({
- room : data,
- })
- })
- .catch((error) => {
- console.error(error);
- });
- }
- onInputChangeResort(e){
- this.setState({value:e.target.value});
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement