import m from "mithril"

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

export default QuestionnaireSection
