<commit_before>/**
 * Created by <NAME>  on 2/1/15.
 */
(function () {

    angular.module('mytodoApp')
        .service('TodoService', ['$http', 'Backand', 'AuthService', TodoService]);

    function TodoService($http, Backand, AuthService) {

        var self = this;
        var baseUrl = Backand.getApiUrl() + '/1/objects/';

        var tableName = 'todo';

        self.readAll = function () {
            return $http({
                method: 'GET',
                url: baseUrl + tableName
            }).then(function(response) {
                return response.data.data;
            });
        };

        self.readOne = function (id) {
            return $http({
                method: 'GET',
                url: baseUrl + tableName + '/' + id
            }).then(function(response) {
                return response.data;
            });
        };

        self.create = function (description) {
            return $http({
                method: 'POST',
                url : baseUrl + tableName,
                data: {
                    description: description,
                    createdBy: AuthService.currentUser.details.id },
                params: {
                    returnObject: true
                }
            }).then(function(response) {
                return response.data;
            });
        };

        self.update = function (id, data) {
            return $http({
                method: 'PUT',
                url : baseUrl + tableName + '/' + id,
                data: data
            }).then(function(response) {
                return response.data;
            });
        };

        self.delete = function (id) {
            return $http({
                method: 'DELETE',
                url : baseUrl + tableName + '/' + id
            })
        };

    }
}());
<commit_msg>create task for guest with username 'anonymous' to get the error from the server<commit_after>/**
 * Created by <NAME>  on 2/1/15.
 */
(function () {

    angular.module('mytodoApp')
        .service('TodoService', ['$http', 'Backand', 'AuthService', TodoService]);

    function TodoService($http, Backand, AuthService) {

        var self = this;
        var baseUrl = Backand.getApiUrl() + '/1/objects/';

        var tableName = 'todo';

        self.readAll = function () {
            return $http({
                method: 'GET',
                url: baseUrl + tableName
            }).then(function(response) {
                return response.data.data;
            });
        };

        self.readOne = function (id) {
            return $http({
                method: 'GET',
                url: baseUrl + tableName + '/' + id
            }).then(function(response) {
                return response.data;
            });
        };

        self.create = function (description) {
            return $http({
                method: 'POST',
                url : baseUrl + tableName,
                data: {
                    description: description,
                    createdBy: AuthService.currentUser.details ? AuthService.currentUser.details.id : 'Anonymous' },
                params: {
                    returnObject: true
                }
            }).then(function(response) {
                return response.data;
            });
        };

        self.update = function (id, data) {
            return $http({
                method: 'PUT',
                url : baseUrl + tableName + '/' + id,
                data: data
            }).then(function(response) {
                return response.data;
            });
        };

        self.delete = function (id) {
            return $http({
                method: 'DELETE',
                url : baseUrl + tableName + '/' + id
            })
        };

    }
}());

{'fraction_non_alphanumeric': 0.1260881034027961, 'fraction_numerical': 0.002637826431020839, 'mean_word_length': 1.2227432590855802, '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': '2823887', 'n_tokens_mistral': 1008, 'n_tokens_neox': 940, 'n_words': 219}