import m from "mithril"

const Respondent = {
    list: [],
    current: {},
    loading: false,
    fetch: function(id) {
        Respondent.loading = true
        m.request({
            url: "http://api.questionnaire.dev/v1/respondents/" + id,
            method: "GET"
        })
        .then(function(res) {
            Respondent.current = res
            Respondent.loading = false
        })
    }
}

export default Respondent
