<commit_before>﻿(function() {
    "use strict";
    angular
        .module('meetupModule')
        .controller('MeetupCreateController', MeetupCreateController)

    MeetupCreateController.$inject = ["$log", "$q", "$resource", "$location"];
    function MeetupCreateController($log, $q, $resource, $location) {
        var vm = this;
        vm.createParams = {};
        vm.submitForm = function() {
            $resource('/api/loggedUser').query(function (userViews) {
                vm.createParams.sponsor = userViews[0].userId;
            }).$promise.then(function () {
                $log.debug(vm.createParams);
                $resource('/api/Meetups').save(vm.createParams)
                    .$promise.then(function () {
                        $log.debug(vm.createParams);
                        $location.path('/index');
                    });
            });
        }

        // TODO: should be refactored to angular style 
        $(".js-meetup-create-where").placepicker();
        $(".js-meetup-create-when").datetimepicker({minDate: '0'});
    }
})();
<commit_msg>hot fix for the 'where' bug when creating a meetup<commit_after>﻿(function() {
    "use strict";
    angular
        .module('meetupModule')
        .controller('MeetupCreateController', MeetupCreateController)

    MeetupCreateController.$inject = ["$log", "$q", "$resource", "$location"];
    function MeetupCreateController($log, $q, $resource, $location) {
        var vm = this;
        vm.createParams = {};
        vm.submitForm = function() {
            $resource('/api/loggedUser').query(function (userViews) {
                vm.createParams.sponsor = userViews[0].userId;
            }).$promise.then(function () {
                //quick and dirty fix for the where bug
                vm.createParams.where = document.querySelector('.js-meetup-create-where').value;
                $log.debug(vm.createParams);
                $resource('/api/Meetups').save(vm.createParams)
                    .$promise.then(function () {
                        $log.debug(vm.createParams);
                        $location.path('/index');
                    });
            });
        }

        // TODO: should be refactored to angular style 
        $(".js-meetup-create-where").placepicker();
        $(".js-meetup-create-when").datetimepicker({minDate: '0'});
    }
})();

{'fraction_non_alphanumeric': 0.15780590717299578, 'fraction_numerical': 0.0016877637130801688, 'mean_word_length': 1.9749058971141782, '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': '7652288', 'n_tokens_mistral': 665, 'n_tokens_neox': 632, 'n_words': 105}