import projectGql from '@/gql/project'

const state = {
    project: [],
}

const getters = {
}

const actions = {
    async setProject({commit}, project){
        commit('SETPROJECT' , project)
    },

    async updateAoi({commit} , input){
        let result = await projectGql.update(input)

        commit('UPDATEAOI' , result)
    },
}

const mutations = {

    SETPROJECT(state,payload ){
        state.project = payload
    },
    
    UPDATEAOI(state,payload){
        state.aoi = { ...payload}; 
    },
}

export default {
    state: {
        ...state
    },
    getters,
    mutations,
    actions
}