2019-03-30 02:57:40 +01:00
|
|
|
import { ITodo, ITodosState, IParamTodo, IDrag, IProjectsState, IProject } from 'model'
|
2019-01-14 22:40:30 +01:00
|
|
|
import { storeBuilder } from './Store/Store'
|
|
|
|
|
|
2019-02-01 04:10:31 +01:00
|
|
|
import Api from '@api'
|
2019-02-27 02:58:41 +01:00
|
|
|
import { tools } from './tools'
|
2019-03-22 15:32:32 +01:00
|
|
|
import * as ApiTables from './ApiTables'
|
2019-02-08 17:10:25 +01:00
|
|
|
import { GlobalStore, Todos, UserStore } from '@store'
|
2019-02-03 14:40:20 +01:00
|
|
|
import globalroutines from './../../globalroutines/index'
|
2019-02-12 12:06:01 +01:00
|
|
|
import { Mutation } from 'vuex-module-decorators'
|
|
|
|
|
import { serv_constants } from '@src/store/Modules/serv_constants'
|
2019-02-27 02:58:41 +01:00
|
|
|
import { GetterTree } from 'vuex'
|
|
|
|
|
import objectId from '@src/js/objectId'
|
2019-03-04 17:28:29 +01:00
|
|
|
import { costanti } from '@src/store/Modules/costanti'
|
2019-02-01 04:10:31 +01:00
|
|
|
|
2019-03-21 20:43:15 +01:00
|
|
|
const nametable = 'todos'
|
|
|
|
|
|
2019-02-27 02:58:41 +01:00
|
|
|
// import _ from 'lodash'
|
2019-01-14 22:40:30 +01:00
|
|
|
|
|
|
|
|
const state: ITodosState = {
|
2019-03-04 17:28:29 +01:00
|
|
|
showtype: costanti.ShowTypeTask.SHOW_LAST_N_COMPLETED,
|
2019-03-04 18:48:07 +01:00
|
|
|
todos: {},
|
2019-02-27 02:58:41 +01:00
|
|
|
categories: [],
|
|
|
|
|
// todos_changed: 1,
|
2019-02-14 18:38:23 +01:00
|
|
|
reload_fromServer: 0,
|
2019-02-04 03:09:15 +01:00
|
|
|
testpao: 'Test',
|
2019-02-27 02:58:41 +01:00
|
|
|
insidePending: false,
|
|
|
|
|
visuLastCompleted: 10
|
2019-01-14 22:40:30 +01:00
|
|
|
}
|
|
|
|
|
|
2019-03-21 20:43:15 +01:00
|
|
|
const fieldtochange: string [] = ['descr', 'completed', 'category', 'expiring_at', 'priority', 'id_prev', 'pos', 'enableExpiring', 'progress']
|
2019-02-27 02:58:41 +01:00
|
|
|
|
|
|
|
|
const b = storeBuilder.module<ITodosState>('Todos', state)
|
2019-02-01 04:10:31 +01:00
|
|
|
const stateGetter = b.state()
|
2019-01-14 22:40:30 +01:00
|
|
|
|
2019-02-27 02:58:41 +01:00
|
|
|
function getindexbycategory(category: string) {
|
|
|
|
|
return state.categories.indexOf(category)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function gettodosByCategory(category: string) {
|
|
|
|
|
const indcat = state.categories.indexOf(category)
|
2019-03-21 20:43:15 +01:00
|
|
|
if (!state.todos[indcat]) {
|
2019-02-27 02:58:41 +01:00
|
|
|
return []
|
2019-03-21 20:43:15 +01:00
|
|
|
}
|
2019-02-27 02:58:41 +01:00
|
|
|
return state.todos[indcat]
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function initcat() {
|
|
|
|
|
|
2019-03-21 20:43:15 +01:00
|
|
|
const tomorrow = new Date()
|
2019-02-27 02:58:41 +01:00
|
|
|
tomorrow.setDate(tomorrow.getDate() + 1)
|
|
|
|
|
|
|
|
|
|
const objtodo: ITodo = {
|
|
|
|
|
// _id: new Date().toISOString(), // Create NEW
|
|
|
|
|
_id: objectId(),
|
|
|
|
|
userId: UserStore.state.userId,
|
|
|
|
|
descr: '',
|
2019-03-22 18:49:38 +01:00
|
|
|
priority: tools.Priority.PRIORITY_NORMAL,
|
2019-02-27 02:58:41 +01:00
|
|
|
completed: false,
|
|
|
|
|
created_at: new Date(),
|
|
|
|
|
modify_at: new Date(),
|
|
|
|
|
completed_at: new Date(),
|
|
|
|
|
category: '',
|
|
|
|
|
expiring_at: tomorrow,
|
|
|
|
|
enableExpiring: false,
|
|
|
|
|
id_prev: '',
|
|
|
|
|
pos: 0,
|
|
|
|
|
modified: false,
|
|
|
|
|
progress: 0
|
|
|
|
|
}
|
|
|
|
|
// return this.copy(objtodo)
|
|
|
|
|
return objtodo
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
2019-01-14 22:40:30 +01:00
|
|
|
namespace Getters {
|
2019-03-28 12:58:34 +01:00
|
|
|
const items_dacompletare = b.read((state: ITodosState) => (cat: string): ITodo[] => {
|
2019-02-27 02:58:41 +01:00
|
|
|
const indcat = getindexbycategory(cat)
|
|
|
|
|
if (state.todos[indcat]) {
|
2019-03-21 20:43:15 +01:00
|
|
|
return state.todos[indcat].filter((todo) => !todo.completed)
|
|
|
|
|
} else {
|
|
|
|
|
return []
|
|
|
|
|
}
|
2019-03-28 12:58:34 +01:00
|
|
|
}, 'items_dacompletare')
|
2019-02-27 02:58:41 +01:00
|
|
|
|
|
|
|
|
const todos_completati = b.read((state: ITodosState) => (cat: string): ITodo[] => {
|
|
|
|
|
const indcat = getindexbycategory(cat)
|
|
|
|
|
if (state.todos[indcat]) {
|
2019-03-21 20:43:15 +01:00
|
|
|
if (state.showtype === costanti.ShowTypeTask.SHOW_LAST_N_COMPLETED) {
|
|
|
|
|
return state.todos[indcat].filter((todo) => todo.completed).slice(0, state.visuLastCompleted)
|
|
|
|
|
} // Show only the first N completed
|
|
|
|
|
else if (state.showtype === costanti.ShowTypeTask.SHOW_ALL) {
|
|
|
|
|
return state.todos[indcat].filter((todo) => todo.completed)
|
|
|
|
|
}
|
|
|
|
|
else {
|
2019-03-04 17:28:29 +01:00
|
|
|
return []
|
2019-03-21 20:43:15 +01:00
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
return []
|
|
|
|
|
}
|
2019-02-27 02:58:41 +01:00
|
|
|
}, 'todos_completati')
|
|
|
|
|
|
|
|
|
|
const doneTodosCount = b.read((state: ITodosState) => (cat: string): number => {
|
|
|
|
|
return getters.todos_completati(cat).length
|
|
|
|
|
}, 'doneTodosCount')
|
|
|
|
|
const TodosCount = b.read((state: ITodosState) => (cat: string): number => {
|
|
|
|
|
const indcat = getindexbycategory(cat)
|
|
|
|
|
if (state.todos[indcat]) {
|
|
|
|
|
return state.todos[indcat].length
|
|
|
|
|
} else {
|
|
|
|
|
return 0
|
|
|
|
|
}
|
|
|
|
|
}, 'TodosCount')
|
2019-01-14 22:40:30 +01:00
|
|
|
|
2019-03-30 02:57:40 +01:00
|
|
|
const getRecordById = b.read((state: ITodosState) => (id: string, cat: string): ITodo => {
|
|
|
|
|
const indcat = getindexbycategory(cat)
|
|
|
|
|
if (state.todos) {
|
|
|
|
|
return state.todos[indcat].find((item) => item._id === id)
|
|
|
|
|
}
|
|
|
|
|
return null
|
|
|
|
|
}, 'getRecordById')
|
|
|
|
|
|
2019-01-14 22:40:30 +01:00
|
|
|
export const getters = {
|
2019-03-28 12:58:34 +01:00
|
|
|
get items_dacompletare() {
|
|
|
|
|
return items_dacompletare()
|
2019-02-27 02:58:41 +01:00
|
|
|
},
|
|
|
|
|
get todos_completati() {
|
|
|
|
|
return todos_completati()
|
|
|
|
|
},
|
|
|
|
|
get doneTodosCount() {
|
|
|
|
|
return doneTodosCount()
|
|
|
|
|
},
|
|
|
|
|
get TodosCount() {
|
|
|
|
|
return TodosCount()
|
2019-03-30 02:57:40 +01:00
|
|
|
},
|
|
|
|
|
get getRecordById() {
|
|
|
|
|
return getRecordById()
|
2019-01-14 22:40:30 +01:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
namespace Mutations {
|
|
|
|
|
|
2019-03-22 01:00:41 +01:00
|
|
|
function findIndTodoById(state: ITodosState, data: IParamTodo) {
|
2019-02-27 02:58:41 +01:00
|
|
|
const indcat = state.categories.indexOf(data.categorySel)
|
|
|
|
|
if (indcat >= 0) {
|
2019-03-28 12:58:34 +01:00
|
|
|
return tools.getIndexById(state.todos[indcat], data.id)
|
2019-02-15 01:25:44 +01:00
|
|
|
}
|
|
|
|
|
return -1
|
|
|
|
|
}
|
|
|
|
|
|
2019-02-27 02:58:41 +01:00
|
|
|
function createNewItem(state: ITodosState, { objtodo, atfirst, categorySel }) {
|
2019-03-04 18:48:07 +01:00
|
|
|
let indcat = state.categories.indexOf(categorySel)
|
|
|
|
|
if (indcat == -1) {
|
|
|
|
|
state.categories.push(categorySel)
|
|
|
|
|
indcat = state.categories.indexOf(categorySel)
|
|
|
|
|
}
|
2019-02-27 02:58:41 +01:00
|
|
|
console.log('createNewItem', objtodo, 'cat=', categorySel, 'state.todos[indcat]', state.todos[indcat])
|
|
|
|
|
if (state.todos[indcat] === undefined) {
|
|
|
|
|
state.todos[indcat] = []
|
|
|
|
|
state.todos[indcat].push(objtodo)
|
2019-03-04 18:48:07 +01:00
|
|
|
console.log('push state.todos[indcat]', state.todos)
|
2019-02-27 02:58:41 +01:00
|
|
|
return
|
|
|
|
|
}
|
2019-03-21 20:43:15 +01:00
|
|
|
if (atfirst) {
|
2019-02-27 02:58:41 +01:00
|
|
|
state.todos[indcat].unshift(objtodo)
|
2019-03-21 20:43:15 +01:00
|
|
|
}
|
|
|
|
|
else {
|
2019-02-27 02:58:41 +01:00
|
|
|
state.todos[indcat].push(objtodo)
|
2019-03-21 20:43:15 +01:00
|
|
|
}
|
2019-02-15 01:25:44 +01:00
|
|
|
|
2019-02-27 02:58:41 +01:00
|
|
|
console.log('state.todos[indcat]', state.todos[indcat])
|
2019-02-15 01:25:44 +01:00
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function deletemyitem(state: ITodosState, myitem: ITodo) {
|
|
|
|
|
// Find record
|
2019-02-27 02:58:41 +01:00
|
|
|
const indcat = state.categories.indexOf(myitem.category)
|
2019-03-22 01:00:41 +01:00
|
|
|
const ind = findIndTodoById(state, { id: myitem._id, categorySel: myitem.category })
|
2019-02-15 01:25:44 +01:00
|
|
|
|
2019-03-22 15:32:32 +01:00
|
|
|
ApiTables.removeitemfromarray(state.todos[indcat], ind)
|
2019-02-15 01:25:44 +01:00
|
|
|
}
|
|
|
|
|
|
2019-02-03 14:40:20 +01:00
|
|
|
export const mutations = {
|
2019-02-15 01:25:44 +01:00
|
|
|
deletemyitem: b.commit(deletemyitem),
|
|
|
|
|
createNewItem: b.commit(createNewItem)
|
2019-02-03 14:40:20 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
2019-01-14 22:40:30 +01:00
|
|
|
namespace Actions {
|
|
|
|
|
|
2019-03-28 12:58:34 +01:00
|
|
|
async function dbLoad(context, { checkPending }) {
|
|
|
|
|
console.log('dbLoad', nametable, checkPending, 'userid=', UserStore.state.userId)
|
2019-02-01 04:10:31 +01:00
|
|
|
|
2019-03-21 20:43:15 +01:00
|
|
|
if (UserStore.state.userId === '') {
|
2019-03-22 15:32:32 +01:00
|
|
|
return false // Login not made
|
|
|
|
|
}
|
2019-02-01 04:10:31 +01:00
|
|
|
|
2019-03-21 20:43:15 +01:00
|
|
|
const ris = await Api.SendReq('/todos/' + UserStore.state.userId, 'GET', null)
|
|
|
|
|
.then((res) => {
|
2019-03-22 15:32:32 +01:00
|
|
|
if (res.data.todos) { // console.log('RISULTANTE CATEGORIES DAL SERVER = ', res.data.categories)
|
2019-02-27 02:58:41 +01:00
|
|
|
state.todos = res.data.todos
|
|
|
|
|
state.categories = res.data.categories
|
|
|
|
|
} else {
|
|
|
|
|
state.todos = [[]]
|
2019-02-12 12:06:01 +01:00
|
|
|
}
|
2019-02-04 03:09:15 +01:00
|
|
|
|
2019-03-21 20:43:15 +01:00
|
|
|
state.showtype = parseInt(GlobalStore.getters.getConfigStringbyId({
|
|
|
|
|
id: costanti.CONFIG_ID_SHOW_TYPE_TODOS,
|
|
|
|
|
default: costanti.ShowTypeTask.SHOW_LAST_N_COMPLETED
|
|
|
|
|
}), 10)
|
2019-03-04 17:28:29 +01:00
|
|
|
|
2019-02-27 02:58:41 +01:00
|
|
|
// console.log('ARRAY TODOS = ', state.todos)
|
2019-03-21 20:43:15 +01:00
|
|
|
if (process.env.DEBUG === '1') {
|
2019-03-28 12:58:34 +01:00
|
|
|
console.log('dbLoad', 'state.todos', state.todos, 'state.categories', state.categories)
|
2019-03-21 20:43:15 +01:00
|
|
|
}
|
2019-02-01 04:10:31 +01:00
|
|
|
|
2019-02-19 02:33:02 +01:00
|
|
|
return res
|
2019-02-01 04:10:31 +01:00
|
|
|
})
|
2019-03-21 20:43:15 +01:00
|
|
|
.catch((error) => {
|
2019-03-28 12:58:34 +01:00
|
|
|
console.log('error dbLoad', error)
|
2019-02-06 18:47:54 +01:00
|
|
|
UserStore.mutations.setErrorCatch(error)
|
2019-02-19 02:33:02 +01:00
|
|
|
return error
|
2019-02-01 04:10:31 +01:00
|
|
|
})
|
2019-02-02 20:13:06 +01:00
|
|
|
|
2019-03-22 15:32:32 +01:00
|
|
|
ApiTables.aftercalling(ris, checkPending, 'categories')
|
2019-02-27 02:58:41 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
async function deleteItem(context, { cat, idobj }) {
|
|
|
|
|
console.log('deleteItem: KEY = ', idobj)
|
2019-03-22 20:51:42 +01:00
|
|
|
|
|
|
|
|
const myarr = gettodosByCategory(cat)
|
|
|
|
|
|
|
|
|
|
const myobjtrov = tools.getElemById(myarr, idobj)
|
2019-02-27 02:58:41 +01:00
|
|
|
|
2019-03-22 01:00:41 +01:00
|
|
|
console.log('myobjtrov', myobjtrov.descr)
|
|
|
|
|
|
2019-03-21 20:43:15 +01:00
|
|
|
if (!!myobjtrov) {
|
2019-03-22 20:51:42 +01:00
|
|
|
const myobjnext = tools.getElemPrevById(myarr, myobjtrov._id)
|
2019-02-27 02:58:41 +01:00
|
|
|
|
2019-03-21 20:43:15 +01:00
|
|
|
if (!!myobjnext) {
|
2019-02-27 02:58:41 +01:00
|
|
|
myobjnext.id_prev = myobjtrov.id_prev
|
|
|
|
|
myobjnext.modified = true
|
|
|
|
|
await modify(context, { myitem: myobjnext, field: 'id_prev' })
|
|
|
|
|
}
|
|
|
|
|
|
2019-03-22 15:32:32 +01:00
|
|
|
ApiTables.table_DeleteRecord(nametable, myobjtrov, idobj)
|
2019-02-27 02:58:41 +01:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2019-03-28 12:58:34 +01:00
|
|
|
async function dbInsert(context, { myobj, atfirst }) {
|
2019-02-27 02:58:41 +01:00
|
|
|
|
|
|
|
|
const objtodo = initcat()
|
|
|
|
|
|
|
|
|
|
objtodo.descr = myobj.descr
|
|
|
|
|
objtodo.category = myobj.category
|
|
|
|
|
|
|
|
|
|
let elemtochange: ITodo = null
|
|
|
|
|
|
2019-03-22 20:51:42 +01:00
|
|
|
const myarr = gettodosByCategory(objtodo.category)
|
|
|
|
|
|
2019-02-27 02:58:41 +01:00
|
|
|
if (atfirst) {
|
|
|
|
|
console.log('INSERT AT THE TOP')
|
2019-03-22 20:51:42 +01:00
|
|
|
elemtochange = tools.getFirstList(myarr)
|
2019-03-22 15:32:32 +01:00
|
|
|
objtodo.id_prev = ApiTables.LIST_START
|
2019-02-27 02:58:41 +01:00
|
|
|
} else {
|
|
|
|
|
console.log('INSERT AT THE BOTTOM')
|
|
|
|
|
// INSERT AT THE BOTTOM , so GET LAST ITEM
|
2019-03-22 20:51:42 +01:00
|
|
|
const lastelem = tools.getLastListNotCompleted(nametable, objtodo.category)
|
2019-02-27 02:58:41 +01:00
|
|
|
|
2019-03-22 15:32:32 +01:00
|
|
|
objtodo.id_prev = (!!lastelem) ? lastelem._id : ApiTables.LIST_START
|
2019-02-27 02:58:41 +01:00
|
|
|
}
|
|
|
|
|
objtodo.modified = false
|
|
|
|
|
|
2019-03-22 20:51:42 +01:00
|
|
|
Todos.mutations.createNewItem({ objtodo, atfirst, categorySel: objtodo.category }) // 1) Create record in Memory
|
2019-02-27 02:58:41 +01:00
|
|
|
|
2019-03-22 20:51:42 +01:00
|
|
|
const id = await globalroutines(context, 'write', nametable, objtodo) // 2) Insert into the IndexedDb
|
2019-02-27 02:58:41 +01:00
|
|
|
|
|
|
|
|
let field = ''
|
2019-03-22 15:32:32 +01:00
|
|
|
if (atfirst) { // update also the last elem
|
2019-03-22 01:00:41 +01:00
|
|
|
if (!!elemtochange) {
|
2019-02-27 02:58:41 +01:00
|
|
|
elemtochange.id_prev = id
|
|
|
|
|
console.log('elemtochange', elemtochange)
|
|
|
|
|
field = 'id_prev'
|
|
|
|
|
|
|
|
|
|
// Modify the other record
|
|
|
|
|
await modify(context, { myitem: elemtochange, field })
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 3) send to the Server
|
2019-03-22 15:32:32 +01:00
|
|
|
return await ApiTables.Sync_SaveItem(nametable, 'POST', objtodo)
|
2019-02-27 02:58:41 +01:00
|
|
|
.then((ris) => {
|
2019-03-22 20:51:42 +01:00
|
|
|
// *** Check if need to be moved because of the --- Priority Ordering --- ...
|
|
|
|
|
|
|
|
|
|
const indelem = tools.getIndexById(myarr, objtodo._id)
|
2019-03-21 20:43:15 +01:00
|
|
|
let itemdragend
|
2019-02-27 02:58:41 +01:00
|
|
|
if (atfirst) {
|
|
|
|
|
// Check the second item, if it's different priority, then move to the first position of the priority
|
|
|
|
|
const secondindelem = indelem + 1
|
2019-03-22 20:51:42 +01:00
|
|
|
if (tools.isOkIndex(myarr, secondindelem)) {
|
|
|
|
|
const secondelem = tools.getElemByIndex(myarr, secondindelem)
|
2019-03-04 17:28:29 +01:00
|
|
|
if (secondelem.priority !== objtodo.priority) {
|
|
|
|
|
itemdragend = {
|
|
|
|
|
field: 'priority',
|
|
|
|
|
idelemtochange: objtodo._id,
|
|
|
|
|
prioritychosen: objtodo.priority,
|
|
|
|
|
category: objtodo.category,
|
|
|
|
|
atfirst
|
|
|
|
|
}
|
2019-02-27 02:58:41 +01:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
// get previous of the last
|
|
|
|
|
const prevlastindelem = indelem - 1
|
2019-03-22 20:51:42 +01:00
|
|
|
if (tools.isOkIndex(myarr, prevlastindelem)) {
|
|
|
|
|
const prevlastelem = tools.getElemByIndex(myarr, prevlastindelem)
|
2019-03-04 17:28:29 +01:00
|
|
|
if (prevlastelem.priority !== objtodo.priority) {
|
|
|
|
|
itemdragend = {
|
|
|
|
|
field: 'priority',
|
|
|
|
|
idelemtochange: objtodo._id,
|
|
|
|
|
prioritychosen: objtodo.priority,
|
|
|
|
|
category: objtodo.category,
|
|
|
|
|
atfirst
|
|
|
|
|
}
|
2019-02-27 02:58:41 +01:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2019-03-21 20:43:15 +01:00
|
|
|
if (itemdragend) {
|
2019-02-27 02:58:41 +01:00
|
|
|
swapElems(context, itemdragend)
|
2019-03-21 20:43:15 +01:00
|
|
|
}
|
2019-02-27 02:58:41 +01:00
|
|
|
return ris
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
async function modify(context, { myitem, field }) {
|
2019-03-22 15:32:32 +01:00
|
|
|
return await ApiTables.table_ModifyRecord(nametable, myitem, fieldtochange)
|
2019-02-27 02:58:41 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
async function swapElems(context, itemdragend: IDrag) {
|
2019-03-28 12:58:34 +01:00
|
|
|
console.log('TODOS swapElems', itemdragend, state.todos, state.categories)
|
2019-03-22 20:51:42 +01:00
|
|
|
|
2019-02-27 02:58:41 +01:00
|
|
|
const cat = itemdragend.category
|
|
|
|
|
const indcat = state.categories.indexOf(cat)
|
2019-03-22 20:51:42 +01:00
|
|
|
const myarr = state.todos[indcat]
|
2019-02-27 02:58:41 +01:00
|
|
|
|
2019-03-22 20:51:42 +01:00
|
|
|
tools.swapGeneralElem(nametable, myarr, itemdragend, fieldtochange)
|
2019-02-27 02:58:41 +01:00
|
|
|
|
2019-02-01 04:10:31 +01:00
|
|
|
}
|
|
|
|
|
|
2019-01-14 22:40:30 +01:00
|
|
|
export const actions = {
|
2019-03-28 12:58:34 +01:00
|
|
|
dbLoad: b.dispatch(dbLoad),
|
2019-02-27 02:58:41 +01:00
|
|
|
swapElems: b.dispatch(swapElems),
|
|
|
|
|
deleteItem: b.dispatch(deleteItem),
|
2019-03-28 12:58:34 +01:00
|
|
|
dbInsert: b.dispatch(dbInsert),
|
2019-02-27 02:58:41 +01:00
|
|
|
modify: b.dispatch(modify)
|
2019-01-14 22:40:30 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Module
|
|
|
|
|
const TodosModule = {
|
|
|
|
|
get state() {
|
|
|
|
|
return stateGetter()
|
|
|
|
|
},
|
|
|
|
|
getters: Getters.getters,
|
2019-02-03 14:40:20 +01:00
|
|
|
mutations: Mutations.mutations,
|
2019-01-14 22:40:30 +01:00
|
|
|
actions: Actions.actions
|
|
|
|
|
}
|
|
|
|
|
|
2019-02-01 04:10:31 +01:00
|
|
|
export default TodosModule
|