load(body) {
        if (!this.element) {
            return;
        }
        let that = this;
        let fet;
        this.loading();
        if (this.method.toLowerCase() === 'get') {
            fet = fetch(this.link, {
                method: that.method,
                headers: that.headers
            })
        } else {
            fet = fetch(this.link, {
                method: that.method,
                headers: that.headers,
                body: JSON.stringify(body)
            });
        }
        fet.then(response => {
            that.statusCode = response.status;
            return response.json()
        })
            .then(data => {
                that.data = data;
                if (data.status === "success") {
                    that.success();
                } else {
                    that.error();
                }
            }).catch(error => {
            that.error();
        })
    }
/**
     * Loads data from the API
     *
     * @param body
     */
Loads data from the API
@param body
Loads data from the API @param body
load(body) {
        if (!this.element) {
            return;
        }
        let that = this;
        let fet;
        this.loading();
        if (this.method.toLowerCase() === 'get') {
            fet = fetch(this.link, {
                method: that.method,
                headers: that.headers
            })
        } else {
            fet = fetch(this.link, {
                method: that.method,
                headers: that.headers,
                body: JSON.stringify(body)
            });
        }
        fet.then(response => {
            that.statusCode = response.status;
            return response.json()
        })
            .then(data => {
                that.data = data;
                if (data.status === "success") {
                    that.success();
                } else {
                    that.error();
                }
            }).catch(error => {
            that.error();
        })
    }
load ( body ) { if ( ! this . element ) { return ; } let that = this ; let fet ; this . loading ( ) ; if ( this . method . toLowerCase ( ) === 'get' ) { fet = fetch ( this . link , { method : that . method , headers : that . headers } ) } else { fet = fetch ( this . link , { method : that . method , headers : that . headers , body : JSON . stringify ( body ) } ) ; } fet . then ( response => { that . statusCode = response . status ; return response . json ( ) } ) . then ( data => { that . data = data ; if ( data . status === "success" ) { that . success ( ) ; } else { that . error ( ) ; } } ) . catch ( error => { that . error ( ) ; } ) }
Loads data from the API
 @param body
Loads data from the API @param body