<commit_before>angular.module('picbit').controller('contactCtrl', function ($scope, $backend) {
  'use strict';

  $scope.sendEmail = function () {
    var message = document.querySelector('#message');
    var sender = document.querySelector('#sender');
    var subject = document.querySelector('#subject');
    var error = document.querySelector('#invalid');
    error.innerHTML = '';
    if (!message.value) {
      error.innerHTML = "*El mensaje no debe estar vacio";
    }

    if (!sender.value || !sender.checkValidity()) {
      error.innerHTML += "<br>*El email debe ser válido";
    }
    if (message.value && sender.checkValidity() && sender.value) {

      var callback = function () {
        document.querySelector('#message').value = '';
        document.querySelector('#sender').value = '';
        document.querySelector('#subject').value = '';
      }
      $backend.sendEmail(message.value, sender.value, subject.value, callback);
    }
  };
});<commit_msg>Fixed #60: arreglado el bug con las peticiones<commit_after>angular.module('picbit').controller('contactCtrl', function ($scope, $backend) {
  'use strict';

  $scope.sendEmail = function () {
    var message = document.querySelector('#message');
    var sender = document.querySelector('#sender');
    var subject = document.querySelector('#subject');
    var error = document.querySelector('#invalid');
    error.innerHTML = '';
    if (!message.value) {
      error.innerHTML = "*El mensaje no debe estar vacio";
    }

    if (!sender.value || !sender.checkValidity()) {
      error.innerHTML += "<br>*El email debe ser válido";
    }
    if (message.value && sender.checkValidity() && sender.value) {

      var callback = function () {
/*        document.querySelector('#message').value = '';
        document.querySelector('#sender').value = '';
        document.querySelector('#subject').value = '';*/
        message.value = '';
        sender.value = '';
        subject.value = '';
      }
      $backend.sendEmail(message.value, sender.value, subject.value, callback);
    }
  };
});
{'fraction_non_alphanumeric': 0.16956521739130434, 'fraction_numerical': 0.000966183574879227, 'mean_word_length': 3.296680497925311, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '3301123', 'n_tokens_mistral': 556, 'n_tokens_neox': 561, 'n_words': 116}