- fix Indexdb: 1) InsertTodo OK

This commit is contained in:
Paolo Arena
2019-02-02 21:16:49 +01:00
parent 3c6b2c7bef
commit 185bd2657d
7 changed files with 51 additions and 30 deletions

View File

@@ -1,6 +1,6 @@
import indexdb from './indexdb'
export default async (context, cmd, table, data = null) => {
console.log('globalroutines', cmd, table, data)
return await indexdb(context, cmd, table, data)
export default async (context, cmd, table, data, id = '') => {
console.log('globalroutines', cmd, table, data, id)
return await indexdb(context, cmd, table, data, id)
}

View File

@@ -39,7 +39,7 @@ async function readfromIndexDbToStateTodos(context) {
}
export default async (context, cmd, table, datakey) => {
export default async (context, cmd, table, datakey, id) => {
if (cmd === 'loadapp') {
// ****** LOAD APP AL CARICAMENTO ! *******
return saveConfigIndexDb(context, datakey)
@@ -56,8 +56,8 @@ export default async (context, cmd, table, datakey) => {
} else if (cmd === 'readall') {
return await storage.getalldata(table)
} else if (cmd === 'read') {
return await storage.getdata(table, datakey)
return await storage.getdata(table, id)
} else if (cmd === 'delete') {
return await storage.deletedata(table, datakey)
return await storage.deletedata(table, id)
}
}