<commit_before>import Vue from 'vue'
import VueResource from 'vue-resource'
import Promise from 'promise'

Vue.use(VueResource)

export const cardService = {

    get(id) {
        return new Promise((resolve, reject) => {
            Vue.http.get(`api/index.php/cards/${id}`).then(response => {
                resolve(response.data)
            }, error => {
                reject(error)
            })
        })
    },

    query() {
        return new Promise((resolve, reject) => {
            Vue.http.get('api/index.php/cards').then(response => {
                resolve(response.data)
            }, error => {
                reject(error)
            })
        })
    },

    save(model) {
        return new Promise((resolve, reject) => {
            Vue.http.post('api/index.php/cards', model).then(response => {
                resolve(response.data)
            }, error => {
                reject(error)
            })
        })
    }

}

export const taskService = {

    queryByCardId(id) {
        return new Promise((resolve, reject) => {
            Vue.http.get(`api/index.php/cards/${id}/tasks`).then(response => {
                resolve(response.data)
            }, error => {
                reject(error)
            })
        })
    },

    save(cardId, model) {
        return new Promise((resolve, reject) => {
            Vue.http.post(`api/index.php/cards/${cardId}/tasks`, model).then(response => {
                resolve(response.data)
            }, error => {
                reject(error)
            })
        })
    },

    delete(id) {
        return new Promise((resolve, reject) => {
            Vue.http.delete(`api/index.php/tasks/${id}`).then(response => {
                resolve(response.data)
            }, error => {
                reject(error)
            })
        })
    },

    update(id, model) {
        return new Promise((resolve, reject) => {
            Vue.http.update(`api/index.php/tasks/${id}`, model).then(response => {
                resolve(response.data)
            }, error => {<commit_msg>fix: updating a task doesnt work<commit_after>import Vue from 'vue'
import VueResource from 'vue-resource'
import Promise from 'promise'

Vue.use(VueResource)

export const cardService = {

    get(id) {
        return new Promise((resolve, reject) => {
            Vue.http.get(`api/index.php/cards/${id}`).then(response => {
                resolve(response.data)
            }, error => {
                reject(error)
            })
        })
    },

    query() {
        return new Promise((resolve, reject) => {
            Vue.http.get('api/index.php/cards').then(response => {
                resolve(response.data)
            }, error => {
                reject(error)
            })
        })
    },

    save(model) {
        return new Promise((resolve, reject) => {
            Vue.http.post('api/index.php/cards', model).then(response => {
                resolve(response.data)
            }, error => {
                reject(error)
            })
        })
    }

}

export const taskService = {

    queryByCardId(id) {
        return new Promise((resolve, reject) => {
            Vue.http.get(`api/index.php/cards/${id}/tasks`).then(response => {
                resolve(response.data)
            }, error => {
                reject(error)
            })
        })
    },

    save(cardId, model) {
        return new Promise((resolve, reject) => {
            Vue.http.post(`api/index.php/cards/${cardId}/tasks`, model).then(response => {
                resolve(response.data)
            }, error => {
                reject(error)
            })
        })
    },

    delete(id) {
        return new Promise((resolve, reject) => {
            Vue.http.delete(`api/index.php/tasks/${id}`).then(response => {
                resolve(response.data)
            }, error => {
                reject(error)
            })
        })
    },

    update(id, model) {
        return new Promise((resolve, reject) => {
            Vue.http.put(`api/index.php/tasks/${id}`, model).then(response => {
                resolve(response.data)
            }, error => {
{'fraction_non_alphanumeric': 0.15216346153846153, 'fraction_numerical': 0.0, 'mean_word_length': 1.4767857142857144, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 45, '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': '1758800', 'n_tokens_mistral': 1188, 'n_tokens_neox': 1160, 'n_words': 177}