<commit_before>'use strict';

angular.module('confRegistrationWebApp')
  .controller('AccessEventCtrl', function ($scope, $http, $modalInstance) {
    $scope.close = function () {
      $modalInstance.dismiss();
    };

    $scope.submit = function (conference, reasonForRequest) {
      console.log(conference, reasonForRequest);
      $http({
        method: 'POST',
        url: 'conferences/' + conference.id + '/permissions',
        data: {
          conferenceId: conference.id,
          reasonForRequest: reasonForRequest
        }
      }).success(function () {
        $modalInstance.close();
      }).error(function (data) {
        alert('Error: ' + data);
      });
    };

    $scope.eventSearch = function(val) {
      return $http.get('conferences?conferenceName=' + encodeURIComponent(val)).then(function(response){
        return response.data;
      });
    };

    $scope.selectEvent = function(item){
      $scope.selectedEvent = item;
    };
  });<commit_msg>Add permisionLevel to request<commit_after>'use strict';

angular.module('confRegistrationWebApp')
  .controller('AccessEventCtrl', function ($scope, $http, $modalInstance) {
    $scope.close = function () {
      $modalInstance.dismiss();
    };

    $scope.submit = function (conference, reasonForRequest) {
      console.log(conference, reasonForRequest);
      $http({
        method: 'POST',
        url: 'conferences/' + conference.id + '/permissions',
        data: {
          conferenceId: conference.id,
          reasonForRequest: reasonForRequest,
          permissionLevel: 'REQUESTED'
        }
      }).success(function () {
        $modalInstance.close();
      }).error(function (data) {
        alert('Error: ' + data);
      });
    };

    $scope.eventSearch = function(val) {
      return $http.get('conferences?conferenceName=' + encodeURIComponent(val)).then(function(response){
        return response.data;
      });
    };

    $scope.selectEvent = function(item){
      $scope.selectedEvent = item;
    };
  });
{'fraction_non_alphanumeric': 0.1495049504950495, 'fraction_numerical': 0.0, 'mean_word_length': 2.7565055762081783, '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': '3614740', 'n_tokens_mistral': 570, 'n_tokens_neox': 567, 'n_words': 97}