Remove TinyMce Added Squire
This commit is contained in:
@@ -22,6 +22,11 @@ router.post('/search', function (req, res) {
|
||||
.then( data => res.send(data) )
|
||||
})
|
||||
|
||||
router.post('/textsearch', function (req, res) {
|
||||
Attachment.textSearch(userId, req.body.searchTerm)
|
||||
.then( data => res.send(data) )
|
||||
})
|
||||
|
||||
router.post('/get', function (req, res) {
|
||||
Attachment.forNote(userId, req.body.noteId)
|
||||
.then( data => res.send(data) )
|
||||
@@ -35,6 +40,11 @@ router.post('/update', function (req, res) {
|
||||
})
|
||||
})
|
||||
|
||||
router.post('/delete', function (req, res) {
|
||||
Attachment.delete(userId, req.body.attachmentId)
|
||||
.then( data => res.send(data) )
|
||||
})
|
||||
|
||||
router.post('/upload', upload.single('file'), function (req, res, next) {
|
||||
|
||||
//Create attachment with file information and node id
|
||||
|
@@ -2,20 +2,30 @@ var express = require('express')
|
||||
var router = express.Router()
|
||||
|
||||
let Notes = require('@models/Note');
|
||||
|
||||
let userId = null
|
||||
let socket = null
|
||||
|
||||
// middleware that is specific to this router
|
||||
router.use(function setUserId (req, res, next) {
|
||||
if(userId = req.headers.userId){
|
||||
if(req.headers.userId){
|
||||
userId = req.headers.userId
|
||||
}
|
||||
if(req.headers.socket){
|
||||
// socket = req.
|
||||
}
|
||||
|
||||
next()
|
||||
})
|
||||
|
||||
router.post('/get', function (req, res) {
|
||||
req.io.emit('welcome_homie', 'Welcome, dont poop from excitement')
|
||||
Notes.get(userId, req.body.noteId)
|
||||
.then( data => res.send(data) )
|
||||
.then( data => {
|
||||
//Join room when user opens note
|
||||
// req.io.join('note_room')
|
||||
res.send(data)
|
||||
})
|
||||
})
|
||||
|
||||
router.post('/delete', function (req, res) {
|
||||
@@ -35,11 +45,12 @@ router.post('/update', function (req, res) {
|
||||
|
||||
router.post('/search', function (req, res) {
|
||||
Notes.search(userId, req.body.searchQuery, req.body.searchTags, req.body.fastFilters)
|
||||
.then( notesAndTags => res.send(notesAndTags))
|
||||
.then( notesAndTags => {
|
||||
res.send(notesAndTags)
|
||||
})
|
||||
})
|
||||
|
||||
router.post('/difftext', function (req, res) {
|
||||
|
||||
Notes.getDiffText(userId, req.body.noteId, req.body.text, req.body.updated)
|
||||
.then( fullDiffText => {
|
||||
//Response should be full diff text
|
||||
@@ -50,6 +61,9 @@ router.post('/difftext', function (req, res) {
|
||||
//Reindex all notes. Not a very good function, not public
|
||||
router.get('/reindex5yu43prchuj903mrc', function (req, res) {
|
||||
|
||||
Notes.fixAttachmentThumbnails()
|
||||
res.send('A whole mess is going on in the background')
|
||||
|
||||
// Notes.stressTest().then( i => {
|
||||
// // Notes.reindexAll().then( result => res.send('Welcome to reindex...oh god'))
|
||||
// })
|
||||
|
Reference in New Issue
Block a user