<commit_before>var restify = require('restify');
var models = require('./models.js');

module.exports = {
  create: function (req, res, next) {
    res.send(models.createCode(req.params));
    return next();
  },

  verify: function (req, res, next) {
    return models.verifyCode(req.params, function (err, code) {
      var httpError = null;
      next.ifError(err);
      if (code == null) {
        httpError = new restify.errors.ResourceNotFoundError("Code not found.");
      }
      else if (code == false) {
        httpError = new restify.errors.BadRequestError("Code already verified");
      }
      else {
        res.send(code);
      }
      return next(httpError);
    });
  }
};<commit_msg>french please<commit_after>var restify = require('restify');
var models = require('./models.js');

module.exports = {
  create: function (req, res, next) {
    res.send(models.createCode(req.params));
    return next();
  },

  verify: function (req, res, next) {
    return models.verifyCode(req.params, function (err, code) {
      var httpError = null;
      next.ifError(err);
      if (code == null) {
        httpError = new restify.errors.ResourceNotFoundError("Code invalide, inconnu.");
      }
      else if (code == false) {
        httpError = new restify.errors.BadRequestError("Code déjà vérifié.");
      }
      else {
        res.send(code);
      }
      return next(httpError);
    });
  }
};
{'fraction_non_alphanumeric': 0.14820042342978124, 'fraction_numerical': 0.0, 'mean_word_length': 2.6831168831168832, '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': '7409026', 'n_tokens_mistral': 438, 'n_tokens_neox': 434, 'n_words': 101}