lib/api/blueprints/_util/actionUtil.js
function(req) {

    var pk = module.exports.parsePk(req);

    // Validate the required `id` parameter
    if (!pk) {

      var err = new Error(
        'No `id` parameter provided.' +
        '(Note: even if the model\'s primary key is not named `id`- ' +
        '`id` should be used as the name of the parameter- it will be ' +
        'mapped to the proper primary key name)'
      );
      err.status = 400;
      throw err;
    }

    return pk;
  }
function(req) {

    var pk = module.exports.parsePk(req);

    // Validate the required `id` parameter
    if (!pk) {

      var err = new Error(
        'No `id` parameter provided.' +
        '(Note: even if the model\'s primary key is not named `id`- ' +
        '`id` should be used as the name of the parameter- it will be ' +
        'mapped to the proper primary key name)'
      );
      err.status = 400;
      throw err;
    }

    return pk;
  }
function ( req ) { var pk = module . exports . parsePk ( req ) ; // Validate the required `id` parameter if ( ! pk ) { var err = new Error ( 'No `id` parameter provided.' + '(Note: even if the model\'s primary key is not named `id`- ' + '`id` should be used as the name of the parameter- it will be ' + 'mapped to the proper primary key name)' ) ; err . status = 400 ; throw err ; } return pk ; }
Parse primary key value from parameters.
Throw an error if it cannot be retrieved.

@param  {Request} req
@return {Integer|String}
Parse primary key value from parameters . Throw an error if it cannot be retrieved .