cont3xt/vueapp/src/components/services/Cont3xtService.js
/**
   * Refreshes data for an integration card
   * @param {String} itype - The itype of the integration card
   * @param {String} source - The integration that was displayed in the card
   * @param {String} value - The value of the query that was presented in the card
   * @returns {Promise} - The promise that either resovles the or rejects in error
   */
Refreshes data for an integration card
@param {String} itype - The itype of the integration card
@param {String} source - The integration that was displayed in the card
@param {String} value - The value of the query that was presented in the card
@returns {Promise} - The promise that either resovles the or rejects in error
Refreshes data for an integration card @param { String } itype - The itype of the integration card @param { String } source - The integration that was displayed in the card @param { String } value - The value of the query that was presented in the card @returns { Promise } - The promise that either resovles the or rejects in error
refresh ({ itype, source, value }) {
    return new Promise((resolve, reject) => {
      fetch(`api/integration/${itype}/${source}/search`, {
        method: 'POST',
        headers: setReqHeaders({ 'Content-Type': 'application/json' }),
        body: JSON.stringify({ query: value })
      }).then((response) => {
        if (!response.ok) { 
          throw new Error(response.statusText);
        }
        return response.json();
      }).then((response) => {
        return resolve(response);
      }).catch((err) => { 
        return reject(err);
      });
    });
  }
refresh ( { itype , source , value } ) { return new Promise ( ( resolve , reject ) => { fetch ( ` ${ itype } ${ source } ` , { method : 'POST' , headers : setReqHeaders ( { 'Content-Type' : 'application/json' } ) , body : JSON . stringify ( { query : value } ) } ) . then ( ( response ) => { if ( ! response . ok ) { throw new Error ( response . statusText ) ; } return response . json ( ) ; } ) . then ( ( response ) => { return resolve ( response ) ; } ) . catch ( ( err ) => { return reject ( err ) ; } ) ; } ) ; }
Refreshes data for an integration card
 @param {String} itype - The itype of the integration card
 @param {String} source - The integration that was displayed in the card
 @param {String} value - The value of the query that was presented in the card
 @returns {Promise} - The promise that either resovles the or rejects in error
Refreshes data for an integration card @param { String } itype - The itype of the integration card @param { String } source - The integration that was displayed in the card @param { String } value - The value of the query that was presented in the card @returns { Promise } - The promise that either resovles the or rejects in error
// test for bad response code // this catches an issue within the ^ .then