mirror of
https://github.com/zadam/trilium.git
synced 2025-10-27 16:26:31 +01:00
Merge branch 'stable'
# Conflicts: # docs/backend_api/BNote.html # docs/backend_api/BackendScriptApi.html # docs/backend_api/services_backend_script_api.js.html # docs/frontend_api/FAttribute.html # docs/frontend_api/FBranch.html # docs/frontend_api/FNote.html # docs/frontend_api/FrontendScriptApi.html # docs/frontend_api/entities_fattachment.js.html # docs/frontend_api/entities_fattribute.js.html # docs/frontend_api/entities_fblob.js.html # docs/frontend_api/entities_fbranch.js.html # docs/frontend_api/entities_fnote.js.html # docs/frontend_api/global.html # docs/frontend_api/index.html # docs/frontend_api/services_frontend_script_api.js.html # package.json # src/services/backend_script_api.js # src/services/build.js
This commit is contained in:
@@ -1202,14 +1202,8 @@ class BNote extends AbstractBeccaEntity {
|
||||
|
||||
/** @returns {BAttachment} */
|
||||
getAttachmentByTitle(title) {
|
||||
return sql.getRows(`
|
||||
SELECT attachments.*
|
||||
FROM attachments
|
||||
WHERE ownerId = ?
|
||||
AND title = ?
|
||||
AND isDeleted = 0
|
||||
ORDER BY position`, [this.noteId, title])
|
||||
.map(row => new BAttachment(row))[0];
|
||||
// cannot use SQL to filter by title since it can be encrypted
|
||||
return this.getAttachments().filter(attachment => attachment.title === title)[0];
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user