- Service Worker: Save on IndexDb and Sync to send after to the DB.

- Insert record on MongoDb, POST, GET.
This commit is contained in:
Paolo Arena
2019-02-01 04:10:31 +01:00
parent f52eb65284
commit 484439efe0
14 changed files with 494 additions and 100 deletions

View File

@@ -6,13 +6,16 @@ export default ({ Vue }) => {
// Insert here the database for IndexDB
new VueIdb({
database: 'test',
database: 'mydb',
version: 1,
schemas: [
{ categories: '++id, sub_categ_id, descr_it, campo2bool, campo3bool' },
{ todos: '++id, userId, category, pos, descr, priority, completed, created_at, modify_at, expiring_at, progress, enableExpiring' }
{ categories: '++_id, sub_categ_id, descr_it, campo2bool, campo3bool' },
{ todos: '++_id, userId, category, pos, descr, priority, completed, created_at, modify_at, completed_at, expiring_at, progress, enableExpiring' },
{ sync_todos: '++_id, userId, category, pos, descr, priority, completed, created_at, modify_at, completed_at, expiring_at, progress, enableExpiring' }
],
options: {
todos: { type: 'list', primary: 'pos', label: 'label', updated_at: 'updated_at' },
sync_todos: { type: 'list', primary: 'pos', label: 'label', updated_at: 'updated_at' },
}
})
}
@@ -25,7 +28,7 @@ export default new VueIdb({
version: 1,
database: 'test',
schemas: [
{ categories: '++id, sub_categ_id, descr_it' }
{ categories: '++_id, sub_categ_id, descr_it' }
]
})
*/