* Fixed a bunch of little bugs
* Added more options to attachment page and filters * Much better rendering and updating on attachment page * Math bug is fixed with better string parsing fixes #14 * Icons are limited to 4 per note * If an image is visible on note preview it will not appear in images preview * Touched up text algorithm to better display note titles
This commit is contained in:
1 parent
7fe702cb1b
commit
fab0b3873f
13 files changed
+208
-38
No files matched your search
@@ -43,7 +43,7 @@ Attachment.textSearch = (userId, searchTerm) => {
|
||||
})
|
||||
}
|
||||
|
||||
Attachment.search = (userId, noteId, attachmentType) => {
|
||||
Attachment.search = (userId, noteId, attachmentType, offset, setSize) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
|
||||
let params = [userId]
|
||||
@@ -54,13 +54,20 @@ Attachment.search = (userId, noteId, attachmentType) => {
|
||||
params.push(noteId)
|
||||
}
|
||||
|
||||
if(Number.isInteger(attachmentType)){
|
||||
query += 'AND attachment_type = ? '
|
||||
params.push(attachmentType)
|
||||
if(attachmentType == 'links'){
|
||||
query += 'AND attachment_type = 1 '
|
||||
}
|
||||
if(attachmentType == 'files'){
|
||||
query += 'AND attachment_type > 1 '
|
||||
}
|
||||
|
||||
|
||||
query += 'ORDER BY last_indexed DESC '
|
||||
|
||||
const limitOffset = parseInt(offset, 10) || 0 //Either parse int, or use zero
|
||||
const parsedSetSize = parseInt(setSize, 10) || 20 //Either parse int, or use zero
|
||||
query += ` LIMIT ${limitOffset}, ${parsedSetSize}`
|
||||
|
||||
db.promise()
|
||||
.query(query, params)
|
||||
.then((rows, fields) => {
|
||||
|
||||
Reference in new issue
Block a user