e87e8513bc
* Cleaned up unused things * Updated squire which had a comment typo update...thats it * Background color picker has matching colors and styles to text color picker * Added new black theme * Moved search to main page, show it on mobile and added options to push things to notes from search with experimental tag searching * Added active note menu buttons based on cursor location in text * Added more instant updating if app is open in two locations for the same user Scratch Pad and home page update with new notes and new text in real time
38 lines
826 B
JavaScript
38 lines
826 B
JavaScript
var express = require('express')
|
|
var router = express.Router()
|
|
|
|
let QuickNote = require('@models/QuickNote');
|
|
|
|
let userId = null
|
|
let masterKey = null
|
|
|
|
// middleware that is specific to this router
|
|
router.use(function setUserId (req, res, next) {
|
|
if(userId = req.headers.userId){
|
|
userId = req.headers.userId
|
|
masterKey = req.headers.masterKey
|
|
}
|
|
|
|
next()
|
|
})
|
|
|
|
//Get quick note text
|
|
router.post('/get', function (req, res) {
|
|
QuickNote.get(userId, masterKey)
|
|
.then( data => res.send(data) )
|
|
})
|
|
|
|
//Push text to quick note
|
|
router.post('/update', function (req, res) {
|
|
QuickNote.update(req.io, userId, req.body.pushText, masterKey)
|
|
.then( data => res.send(data) )
|
|
})
|
|
|
|
//Push text to quick note
|
|
router.post('/new', function (req, res) {
|
|
QuickNote.newNote(userId)
|
|
.then( data => res.send(data) )
|
|
})
|
|
|
|
|
|
module.exports = router |