src/wootric/wootric-feeder.js
/**
   *
   * Fetcher for the Net Promoter Score on Wootric.
   *
   * @param {Object} config - The config require for the fetch
   * @return {Promise} - The promisified geckoFormatted result of the fetch
   *
   */
Fetcher for the Net Promoter Score on Wootric.
@param {Object} config - The config require for the fetch
@return {Promise} - The promisified geckoFormatted result of the fetch
Fetcher for the Net Promoter Score on Wootric . @param { Object } config - The config require for the fetch @return { Promise } - The promisified geckoFormatted result of the fetch
async fetchNPS(config) {
    const {
      last30Days,
      today,
    } = Util.getAllDates();
    const nps = await this.requestWootricFor(
      '/nps_summary', {
        'date[start]': Util.convertDate(last30Days),
        'date[end]': Util.convertDate(today),
      }
    );
    const items = npsNecessaryKeys.reduce((items, {label, entrie}) => {
      items.push([
        label, nps[entrie],
      ]);
      return items;
    }, []);
    return GeckoBoardFormatter.toLeaderboard(items);
  }
async fetchNPS ( config ) { const { last30Days , today , } = Util . getAllDates ( ) ; const nps = await this . requestWootricFor ( '/nps_summary' , { 'date[start]' : Util . convertDate ( last30Days ) , 'date[end]' : Util . convertDate ( today ) , } ) ; const items = npsNecessaryKeys . reduce ( ( items , { label , entrie } ) => { items . push ( [ label , nps [ entrie ] , ] ) ; return items ; } , [ ] ) ; return GeckoBoardFormatter . toLeaderboard ( items ) ; }
Fetcher for the Net Promoter Score on Wootric.
Fetcher for the Net Promoter Score on Wootric .
/*
        return GeckoBoardFormatter.toNumberAndSecondStat({
          'absolute': true,
          'value': Number.parseInt(nps),
        }, {
          'value': Number.parseInt(oldNps),
        });
    */