Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
/** @module db */
const PouchDB = require('pouchdb-browser').default
const uuidv4 = require('uuid/v4')
/** Initialize Schema */
const notesDB = new PouchDB('notes')
const noteBooksDB = new PouchDB('notebooks')
/**
* Fetches all notes from database
* @return {Promise} of the result
* */
const fetchNotes = function () {
return notesDB.allDocs({ include_docs: true })
}
/**
* Adds / Updates a note to database.
* @param {string} id for the note
* @param {string} title for the note
* @param {string} content for the note
* @param {string} modified date for the note
/** @module db */
const PouchDB = require('pouchdb-browser').default
const uuidv4 = require('uuid/v4')
/** Initialize Schema */
const notesDB = new PouchDB('notes')
const noteBooksDB = new PouchDB('notebooks')
/**
* Fetches all notes from database
* @return {Promise} of the result
* */
const fetchNotes = function () {
return notesDB.allDocs({ include_docs: true })
}
/**
* Adds / Updates a note to database.
* @param {string} id for the note
* @param {string} title for the note
* @param {string} content for the note
* @param {string} modified date for the note
* @param {string} rev used in case of updating existing note