mardi 25 août 2020

Received response not set

I fetch the data from back-end and it successfully received,but some time it cannot read .because in my code if condition not fire but received states is success(it print in the console log).

CommonPost('/api/Transactions/SaveDigitalCouponTransactionDetails', null, digitalCouponModel)
                .then((data) => {
                    this.hideLoading();
                    console.log("data");
                    console.log(data);
                    if (data.statusCode == "Success") {
                        this.setState({
                            messageModal: {
                                messageType: data.statusCode,
                                messageDescription: this.state.messages['DigitalCouponSuccess'] + '  Pin Is  ' + data.message,
                                isModalHidden: false
                            }
                        });
                       
                        this.clear();
                    }
                    else if (data.statusCode == "TagitResponceError") {
                        this.setState({
                            messageModal: {
                                messageType: "Error",
                                messageDescription: data.data,
                                isModalHidden: false
                            }
                        });
                    }
                   
                    else {
                        this.setState({
                            messageModal: {
                                messageType: "Error",
                                messageDescription: this.state.messages['DigitalCouponError'],
                                isModalHidden: false
                            }
                        });
                    }
                })
                .catch((e) => {
                    this.hideLoading();
                });
        }

Aucun commentaire:

Enregistrer un commentaire