fetchDetailData() {
        fetch(apiUrl + "getData/" + this.state.storeKey)
            .then(res => res.json())
            .then(
                (result) => {
                    let fetchData = {},
                        errorMsg = null;
                    if (result.value) {
                        try {
                            fetchData = JSON.parse(result.value);
                        } catch (e) {
                            errorMsg = e.toString();
                        }
                    }
                    if (errorMsg) {
                        // show error message (if provided by the API)
                        this.setState({
                            isLoaded: true,
                            error: {
                                message: errorMsg
                            }
                        });
                    } else {
                        // attach data (provided by the API) to the state
                        fetchData.key = this.state.storeKey;
                        this.setState({
                            isLoaded: true,
                            data: fetchData
                        });
                    }
                },
                (error) => {
                    this.setState({
                        isLoaded: true,
                        error
                    });
                }
            );
    }
/**
     * Fetch asset detail data (if asset-key was given)
     */
Fetch asset detail data (if asset-key was given)
Fetch asset detail data ( if asset - key was given )
fetchDetailData() {
        fetch(apiUrl + "getData/" + this.state.storeKey)
            .then(res => res.json())
            .then(
                (result) => {
                    let fetchData = {},
                        errorMsg = null;
                    if (result.value) {
                        try {
                            fetchData = JSON.parse(result.value);
                        } catch (e) {
                            errorMsg = e.toString();
                        }
                    }
                    if (errorMsg) {
                        this.setState({
                            isLoaded: true,
                            error: {
                                message: errorMsg
                            }
                        });
                    } else {
                        fetchData.key = this.state.storeKey;
                        this.setState({
                            isLoaded: true,
                            data: fetchData
                        });
                    }
                },
                (error) => {
                    this.setState({
                        isLoaded: true,
                        error
                    });
                }
            );
    }
fetchDetailData ( ) { fetch ( apiUrl + "getData/" + this . state . storeKey ) . then ( res => res . json ( ) ) . then ( ( result ) => { let fetchData = { } , errorMsg = null ; if ( result . value ) { try { fetchData = JSON . parse ( result . value ) ; } catch ( e ) { errorMsg = e . toString ( ) ; } } if ( errorMsg ) { this . setState ( { isLoaded : true , error : { message : errorMsg } } ) ; } else { fetchData . key = this . state . storeKey ; this . setState ( { isLoaded : true , data : fetchData } ) ; } } , ( error ) => { this . setState ( { isLoaded : true , error } ) ; } ) ; }
Fetch asset detail data (if asset-key was given)
Fetch asset detail data ( if asset - key was given )
// show error message (if provided by the API) // attach data (provided by the API) to the state