lib/chickadee.js
function convertOptionsParamsToIds(req, instance, options, callback) {
  var err;

  if(options.id) {
    var isValidID = reelib.identifier.isValid(options.id);
    if(!isValidID) {
      err = 'Invalid id';
    }
    options.ids = [options.id];
    delete options.id;
    callback(err);
  }
  else if(options.directory) {
    instance.associations.retrieveIdsByParams(req, options.directory, null,
                                              function(ids) {
      options.ids = ids;
      delete options.directory;
      callback(err);
    });
  }
  else if(options.tags) {
    instance.associations.retrieveIdsByParams(req, null, options.tags,
                                              function(ids) {
      options.ids = ids;
      delete options.tags;
      callback(err);
    });
  }
}
function convertOptionsParamsToIds(req, instance, options, callback) {
  var err;

  if(options.id) {
    var isValidID = reelib.identifier.isValid(options.id);
    if(!isValidID) {
      err = 'Invalid id';
    }
    options.ids = [options.id];
    delete options.id;
    callback(err);
  }
  else if(options.directory) {
    instance.associations.retrieveIdsByParams(req, options.directory, null,
                                              function(ids) {
      options.ids = ids;
      delete options.directory;
      callback(err);
    });
  }
  else if(options.tags) {
    instance.associations.retrieveIdsByParams(req, null, options.tags,
                                              function(ids) {
      options.ids = ids;
      delete options.tags;
      callback(err);
    });
  }
}
function convertOptionsParamsToIds ( req , instance , options , callback ) { var err ; if ( options . id ) { var isValidID = reelib . identifier . isValid ( options . id ) ; if ( ! isValidID ) { err = 'Invalid id' ; } options . ids = [ options . id ] ; delete options . id ; callback ( err ) ; } else if ( options . directory ) { instance . associations . retrieveIdsByParams ( req , options . directory , null , function ( ids ) { options . ids = ids ; delete options . directory ; callback ( err ) ; } ) ; } else if ( options . tags ) { instance . associations . retrieveIdsByParams ( req , null , options . tags , function ( ids ) { options . ids = ids ; delete options . tags ; callback ( err ) ; } ) ; } }
Convert the id, directory or tags within options to ids.
@param {Object} req The request which originated this function call.
@param {Chickadee} instance The given chickadee instance.
@param {Object} options The given options.
@param {callback} callback Function to call on completion.
Convert the id directory or tags within options to ids .