server/src/Entity/api.js
/**
    * Method to check whether the API Token is valid or not.
    * @returns {Promise<unknown>}
    */
Method to check whether the API Token is valid or not.
@returns {Promise}
Method to check whether the API Token is valid or not . @returns { Promise }
isValid() {
      return new Promise((resolve, reject) => {
         database.runSp(constants.SP_CHECK_API_TOKEN, [this._apiToken]).then(_resultSet => {
            const result = _resultSet[0][0];
            if (result[constants.IS_VALID] === 1) {
               resolve(true);
            } else {
               reject(false);
            }
         }).catch(err => {
            printer.printError(err);
            reject(err);
         });
      });
   }
isValid ( ) { return new Promise ( ( resolve , reject ) => { database . runSp ( constants . SP_CHECK_API_TOKEN , [ this . _apiToken ] ) . then ( _resultSet => { const result = _resultSet [ 0 ] [ 0 ] ; if ( result [ constants . IS_VALID ] === 1 ) { resolve ( true ) ; } else { reject ( false ) ; } } ) . catch ( err => { printer . printError ( err ) ; reject ( err ) ; } ) ; } ) ; }
Method to check whether the API Token is valid or not.
Method to check whether the API Token is valid or not .