<commit_before>var mongoose = require('mongoose');
var TournamentContext = mongoose.model('TournamentContext');

module.exports.tournamentcontext = function(req, res) {

  //Search in Database tournament data
  TournamentContext.find({}, "id name description date reglement privacy organizer capacity tournamentGemProperty tournamentChallongeProperty", 
    function(err, docs){console.log("Boum" + err);})
  .exec(function(err, result) {
        console.log("Result" + JSON.stringify(result));
        res.status(200).json(result);
      });
  };


  module.exports.create_event = function (req, res){
  	var event = new TournamentContext()
  	var reqBody  = req.body
  	console.log("Body " + JSON.stringify(req.headers))

  	//Parse into event
  	event.id=reqBody.id
  	event.name=reqBody.name
  	event.description=reqBody.description
  	event.date=reqBody.date
  	event.reglement=reqBody.reglement
  	event.privacy=reqBody.privacy
  	event.organizer=reqBody.organizer
  	event.capacity=reqBody.capacity 


  	if(reqBody.tournamentGemProperty){
  		var tournamentGemProperty = {}
  		tournamentGemProperty.gemNumber=reqBody.tournamentGemProperty.gemNumber
  		tournamentGemProperty.password=reqBody.tournamentGemProperty.password
  		event.tournamentGemProperty=tournamentGemProperty
  	} else {
  		console.log("Not managed")
  	}

  	event.save(function(err){
  		res.status(200).send("OK");
  	})

  };


  <commit_msg>Correction gemnumber<commit_after>var mongoose = require('mongoose');
var TournamentContext = mongoose.model('TournamentContext');

module.exports.tournamentcontext = function(req, res) {

  //Search in Database tournament data
  TournamentContext.find({}, "id name description date reglement privacy organizer capacity tournamentGemProperty tournamentChallongeProperty", 
    function(err, docs){console.log("Boum" + err);})
  .exec(function(err, result) {
        console.log("Result" + JSON.stringify(result));
        res.status(200).json(result);
      });
  };


  module.exports.create_event = function (req, res){
  	var event = new TournamentContext()
  	var reqBody  = req.body
  	console.log("Body " + JSON.stringify(req.headers))

  	//Parse into event
  	event.id=reqBody.id
  	event.name=reqBody.name
  	event.description=reqBody.description
  	event.date=reqBody.date
  	event.reglement=reqBody.reglement
  	event.privacy=reqBody.privacy
  	event.organizer=reqBody.organizer
  	event.capacity=reqBody.capacity 


  	if(reqBody.tournamentGemProperty){
  		var tournamentGemProperty = {}
  		tournamentGemProperty.gemnumber=reqBody.tournamentGemProperty.gemnumber
  		tournamentGemProperty.password=<PASSWORD>
  		event.tournamentGemProperty=tournamentGemProperty
  	} else {
  		console.log("Not managed")
  	}

  	event.save(function(err){
  		res.status(200).send("OK");
  	})

  };


  
{'fraction_non_alphanumeric': 0.11673151750972763, 'fraction_numerical': 0.004244782454899187, 'mean_word_length': 4.315789473684211, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, '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': '3211414', 'n_tokens_mistral': 955, 'n_tokens_neox': 903, 'n_words': 137}