Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- componentDidMount(){
- const token = this.props.token;
- const { navigation } = this.props;
- const itemId = navigation.getParam('itemId', 'NO-ID');
- const itemId2 = navigation.getParam('itemId2', 'NO-ID');
- const otherParam = navigation.getParam('otherParam', 'some default value');
- fetch('https://icartos.com/mobile/request?tk='+token+'&function=getAntecipationPeriod&dt_inicial='+itemId+'&dt_final='+itemId2)
- .then((response) => response.json())
- .then((responseJson) => {
- let state = this.state;
- state.response = responseJson.response;
- this.setState(state);
- if(responseJson.status == 1){
- {this.state.response = responseJson.response}
- this.setState({loading: "0"});
- }else{
- this.props.navigation.navigate('Login');
- }
- })
- .catch((error) => {
- {this.state.response = "[erro]"}
- this.setState({loading: "0"});
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement