<commit_before>const axios = require('axios');

const IssuesApi = {

    getIssues: function(){
        var self = this;
        return axios.get('/issue/get')
            .then(function(response){
                return response.data;
            })
            .catch(function(error){
                return error;
            });
    },

    updateStatus: function(issueId, statusId){
        var self = this;
        return axios.post('/issue/updatestatus', {
                issueId: issueId
                , status : statusId
            })
            .then(function(response){
                return {
                    error: false
                };
            })
            .catch(function(error){
                return {
                    error: true
                };
            });
    },
    
    createIssue: function(projectId, title, description, priorityId, assigneeId){
        var self = this;
        return axios.post('/issue/new', {
                projectId: projectId
                , title : title
                , description: description
                , priorityId: priorityId
                , assigneeId: assigneeId
            })
            .then(function(response){                
                return {
                    error: false,
                    issueId: response.data 
                };
            })
            .catch(function(error){
                console.log('error', error);
                return {
                    error: true
                };
            });
    },

    updateAssignee: function(issueId, assigneeId){
        var self = this;
        return axios.post('/issue/updateassignee', {
            issueId: issueId
            , assigneeId : assigneeId
        })
            .then(function(response){
                return {
                    error: false
                };
            })
            .catch(function(error){
                return {
                    error: true
                };
            });
    },

    updatePriority: function(issueId, priorityId){
        var self = this;
        return axios.post('/issue/updatepriority', {
            issueId: issueId
            , priorityId : priorityId
        })
            .then(function(response){
                return {
                    error: false
                };
            })
            .catch(function(error){
                return {
                    error: true
                };
            });
    },

};

export { IssuesApi };<commit_msg>added api for adding comment.<commit_after>const axios = require('axios');

const IssuesApi = {

    getIssues: function () {
        var self = this;
        return axios.get('/issue/get')
            .then(function (response) {
                return response.data;
            })
            .catch(function (error) {
                return error;
            });
    },

    updateStatus: function (issueId, statusId) {
        var self = this;
        return axios.post('/issue/updatestatus', {
            issueId: issueId
            , status: statusId
        })
            .then(function (response) {
                return {
                    error: false
                };
            })
            .catch(function (error) {
                return {
                    error: true
                };
            });
    },

    createIssue: function (projectId, title, description, priorityId, assigneeId) {
        var self = this;
        return axios.post('/issue/new', {
            projectId: projectId
            , title: title
            , description: description
            , priorityId: priorityId
            , assigneeId: assigneeId
        })
            .then(function (response) {
                return {
                    error: false,
                    issueId: response.data
                };
            })
            .catch(function (error) {
                console.log('error', error);
                return {
                    error: true
                };
            });
    },

    updateAssignee: function (issueId, assigneeId) {
        var self = this;
        return axios.post('/issue/updateassignee', {
            issueId: issueId
            , assigneeId: assigneeId
        })
            .then(function (response) {
                return {
                    error: false
                };
            })
            .catch(function (error) {
                return {
                    error: true
                };
            });
    },

    updatePriority: function (issueId, priorityId) {
        var self = this;
        return axios.post('/issue/updatepriority', {
            issueId: issueId
            , priorityId: priorityId
        })
            .then(function (response) {
                return {
                    error: false
                };
            })
            .catch(function (error) {
                return {
                    error: true
                };
            });
    },

    submitComment: function (issueId, comment) {
        var self = this;
        return axios.post('/issue/addcomment', {
            issueId: issueId
            , comment: comment
        })
            .then(function (response) {
                return {
                    error: false
                };
            })
            .catch(function (error) {
                return {
                    error: true
                };
            });
    },

};

export { IssuesApi };
{'fraction_non_alphanumeric': 0.09834875703139176, 'fraction_numerical': 0.0, 'mean_word_length': 0.9870223503965393, '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': '3398503', 'n_tokens_mistral': 1360, 'n_tokens_neox': 1257, 'n_words': 267}