<commit_before>'use strict';

angular.module('ehelseEditor').controller('NewTopicModalController', [ '$scope', "$rootScope", "ModalService", function($scope, $rootScope, ModalService) {

    $scope.newTopic = {
        "title" : "",
        "description" : "",
        "isInCatalog": false,
        "parentId": $scope.selectedTopicId,
        "sequence": 1,
        "comment": ""
    };

    $rootScope.postNewTopic = function(topic){
        console.log("postNewTopic kjører");

        if(topic.parentId == "null"){
            topic.parentId = null;
        }

        $scope.post(
            'topics/',
            $scope.newTopic,
            function(data){
                console.log("New topic created");
                console.log(data);
                console.log($scope.newTopic);
                $rootScope.reloadTopic(data);
                $rootScope.notifyTopicSuccess("Nytt tema har blitt opprettet");
                $rootScope.reloadTopicTupleList();
            }
            ,
            function(){
                console.log("New topic could not be created");
                $rootScope.notifyTopicError("Tema ble ikke opprettet");
            }
        );
    };
}]);<commit_msg>Fixed toast<commit_after>'use strict';

angular.module('ehelseEditor').controller('NewTopicModalController', [ '$scope', "$rootScope", "ModalService", function($scope, $rootScope, ModalService) {

    $scope.newTopic = {
        "title" : "",
        "description" : "",
        "isInCatalog": false,
        "parentId": $scope.selectedTopicId,
        "sequence": 1,
        "comment": ""
    };

    $rootScope.postNewTopic = function(topic){
        console.log("postNewTopic kjører");

        if(topic.parentId == "null"){
            topic.parentId = null;
        }

        $scope.post(
            'topics/',
            $scope.newTopic,
            function(data){
                console.log("New topic created");
                console.log(data);
                console.log($scope.newTopic);
                $rootScope.reloadTopic(data);
                $rootScope.notifySuccess("Nytt tema har blitt opprettet", 3000);
                $rootScope.reloadTopicTupleList();
            }
            ,
            function(){
                console.log("New topic could not be created");
                $rootScope.notifyError("Tema ble ikke opprettet", 5000);
            }
        );
    };
}]);
{'fraction_non_alphanumeric': 0.14072847682119205, 'fraction_numerical': 0.0041390728476821195, 'mean_word_length': 1.8235981308411215, 'pattern_counts': {'":': 8, '<': 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': '6078827', 'n_tokens_mistral': 682, 'n_tokens_neox': 645, 'n_words': 111}