<commit_before>var db = require('../models');
exports.listar = function(request, reply){
  if (request.params.idTipo){
    db.TipoEvento.findOne({_id: request.params.idTipo}, function(err, tipo){
      if (err){
        reply({statusCode: 600, error: "Database", message:"TipoEvento no encontrado"});
      } else if (tipo){
        reply({statusCode:200,tipo:tipo});
      } else {
        reply({statusCode: 600, error: "Database", message:"TipoEvento no encontrado"});
      }
    });
  } else {
    db.TipoEvento.find(function(err, tipos){
      if (err){
        reply({statusCode: 600, error: "Database", message:"TipoEvento no encontrado"});
      } else if (tipos){
        reply({statusCode:200,tipos:tipos});
      } else {
        reply({statusCode: 600, error: "Database", message:"TipoEvento no encontrado"});
      }
    });
  }
};
exports.create = function(request, reply){
  new db.Equipo(request.payload).save(function(err, equipo, numberAffected){
    if(err){
      return reply({statusCode: 600, error: "Database", message: "Error de Base de datos."});
    }
    return reply({statusCode: 200, _id: equipo._id});
  });
}
exports.save = function(request, reply){
  var equipo = request.payload;
  equipo.modified = Date.now();
  db.Equipo.update({_id:request.params.idEquipo}, {$set: equipo}, function(err, raw){
    if (err) {
      console.log("EQUIPOS_SAVE err="+JSON.stringify(err));
      return reply({statusCode:600});
    }
    return reply({statusCode: 200});
  });
}
exports.delete = function(request, reply){
  db.Equipo.remove({_id:request.params.idEquipo}, function(err){
    if (err) {
      console.log("ATLETAS_DELETE err="+JSON.stringify(err));
      return reply({statusCode:600});
    }
    return reply({statusCode: 200});
  });
};<commit_msg>Corrección de nombre de variable<commit_after>var db = require('../models');
exports.listar = function(request, reply){
  if (request.params.idTipo){
    db.TipoEvento.findOne({_id: request.params.idTipo}, function(err, tipo){
      if (err){
        reply({statusCode: 600, error: "Database", message:"TipoEvento no encontrado"});
      } else if (tipo){
        reply({statusCode:200,tipo:tipo});
      } else {
        reply({statusCode: 600, error: "Database", message:"TipoEvento no encontrado"});
      }
    });
  } else {
    db.TipoEvento.find(function(err, tipos){
      if (err){
        reply({statusCode: 600, error: "Database", message:"TipoEvento no encontrado"});
      } else if (tipos){
        reply({statusCode:200,tipos:tipos});
      } else {
        reply({statusCode: 600, error: "Database", message:"TipoEvento no encontrado"});
      }
    });
  }
};
exports.create = function(request, reply){
  new db.TipoEvento(request.payload).save(function(err, tipoEvento, numberAffected){
    if(err){
      return reply({statusCode: 600, error: "Database", message: "Error de Base de datos."});
    }
    return reply({statusCode: 200, _id: tipoEvento._id});
  });
}
exports.save = function(request, reply){
  var tipoEvento = request.payload;
  tipoEvento.modified = Date.now();
  db.TipoEvento.update({_id:request.params.idTipo}, {$set: tipoEvento}, function(err, raw){
    if (err) {
      console.log("TIPO_EVENTOS_SAVE err="+JSON.stringify(err));
      return reply({statusCode:600});
    }
    return reply({statusCode: 200});
  });
}
exports.delete = function(request, reply){
  db.TipoEvento.remove({_id:request.params.idTipo}, function(err){
    if (err) {
      console.log("TIPO_EVENTOS_DELETE err="+JSON.stringify(err));
      return reply({statusCode:600});
    }
    return reply({statusCode: 200});
  });
};
{'fraction_non_alphanumeric': 0.17067108533554268, 'fraction_numerical': 0.01988400994200497, 'mean_word_length': 3.6977950713359276, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7120339', 'n_tokens_mistral': 1253, 'n_tokens_neox': 1189, 'n_words': 238}