Fixing quick notes
Updating all the icons making search bar thinner
This commit is contained in:
@@ -105,7 +105,7 @@ Note.create = (userId, noteText, quickNote = 0) => {
|
||||
const created = Math.round((+new Date)/1000)
|
||||
|
||||
db.promise()
|
||||
.query(`INSERT INTO note_raw_text (text) VALUE ('')`)
|
||||
.query(`INSERT INTO note_raw_text (text) VALUE (?)`, [noteText])
|
||||
.then( (rows, fields) => {
|
||||
|
||||
const rawTextId = rows[0].insertId
|
||||
|
@@ -10,7 +10,9 @@ QuickNote.get = (userId) => {
|
||||
|
||||
db.promise()
|
||||
.query(`
|
||||
SELECT id, text FROM note WHERE quick_note = 1 AND user_id = ? LIMIT 1
|
||||
SELECT note.id, text FROM note
|
||||
JOIN note_raw_text ON (note_raw_text.id = note.note_raw_text_id)
|
||||
WHERE quick_note = 1 AND user_id = ? LIMIT 1
|
||||
`, [userId])
|
||||
.then((rows, fields) => {
|
||||
|
||||
@@ -53,8 +55,10 @@ QuickNote.update = (userId, pushText) => {
|
||||
|
||||
db.promise()
|
||||
.query(`
|
||||
SELECT id, text, color, pinned, archived
|
||||
FROM note WHERE quick_note = 1 AND user_id = ? LIMIT 1
|
||||
SELECT note.id, text, color, pinned, archived
|
||||
FROM note
|
||||
JOIN note_raw_text ON (note_raw_text.id = note.note_raw_text_id)
|
||||
WHERE quick_note = 1 AND user_id = ? LIMIT 1
|
||||
`, [userId])
|
||||
.then((rows, fields) => {
|
||||
|
||||
@@ -94,20 +98,4 @@ QuickNote.update = (userId, pushText) => {
|
||||
|
||||
//Note.create(userId, 'Quick Note', 1)
|
||||
|
||||
}
|
||||
|
||||
QuickNote.create = (userId, noteText) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
|
||||
if(userId == null || userId < 10){ reject('User Id required to create note') }
|
||||
|
||||
const created = Math.round((+new Date)/1000)
|
||||
|
||||
db.promise()
|
||||
.query('INSERT INTO note (user_id, text, created) VALUES (?,?,?)', [userId, noteText, created])
|
||||
.then((rows, fields) => {
|
||||
resolve(rows[0].insertId) //Only return the new note ID when creating a new note
|
||||
})
|
||||
.catch(console.log)
|
||||
})
|
||||
}
|
Reference in New Issue
Block a user