addSuite(suite) {
    try {
      db.get('suites')
        .insert(suite) // TODO: consider upsert/update case when key already exists
        .write();

      return true;
    } catch (e) {
      let knownError = '';
      if (e.toString().includes('duplicate id')) knownError = `The Suite Key "${suite.key}" already exists.`;
      console.log(`\n* Oops! This Suite can't be added. ${knownError}`);
      if (!knownError) console.log(`[${e}]`);

      return false;
    }
  }
/**
   * Add specified Suite object to array of Suites in JSON data file. Any errors are logged to the console
   * @param {object} suite Suite object with fields as specified in the solution admin schema (config.yml)
   * @returns True on success, false otherwise
   */
Add specified Suite object to array of Suites in JSON data file. Any errors are logged to the console
@param {object} suite Suite object with fields as specified in the solution admin schema (config.yml)
@returns True on success, false otherwise
Add specified Suite object to array of Suites in JSON data file . Any errors are logged to the console @param { object } suite Suite object with fields as specified in the solution admin schema ( config . yml ) @returns True on success false otherwise
addSuite(suite) {
    try {
      db.get('suites')
        .insert(suite) 
        .write();
      return true;
    } catch (e) {
      let knownError = '';
      if (e.toString().includes('duplicate id')) knownError = `The Suite Key "${suite.key}" already exists.`;
      console.log(`\n* Oops! This Suite can't be added. ${knownError}`);
      if (!knownError) console.log(`[${e}]`);
      return false;
    }
  }
addSuite ( suite ) { try { db . get ( 'suites' ) . insert ( suite ) . write ( ) ; return true ; } catch ( e ) { let knownError = '' ; if ( e . toString ( ) . includes ( 'duplicate id' ) ) knownError = ` ${ suite . key } ` ; console . log ( ` \n ${ knownError } ` ) ; if ( ! knownError ) console . log ( ` ${ e } ` ) ; return false ; } }
Add specified Suite object to array of Suites in JSON data file.
Add specified Suite object to array of Suites in JSON data file .
// TODO: consider upsert/update case when key already exists