This commit is contained in:
zadam
2023-03-16 12:17:55 +01:00
parent eee05a4d01
commit b6efc954bd
19 changed files with 127 additions and 135 deletions

View File

@@ -121,12 +121,12 @@ class Becca {
return row ? new BNoteRevision(row) : null;
}
/** @returns {BNoteAttachment|null} */
getNoteAttachment(noteAttachmentId) {
const row = sql.getRow("SELECT * FROM note_attachments WHERE noteAttachmentId = ?", [noteAttachmentId]);
/** @returns {BAttachment|null} */
getAttachment(attachmentId) {
const row = sql.getRow("SELECT * FROM attachments WHERE attachmentId = ?", [attachmentId]);
const BNoteAttachment = require("./entities/bnote_attachment"); // avoiding circular dependency problems
return row ? new BNoteAttachment(row) : null;
const BAttachment = require("./entities/battachment"); // avoiding circular dependency problems
return row ? new BAttachment(row) : null;
}
/** @returns {BOption|null} */
@@ -151,8 +151,8 @@ class Becca {
if (entityName === 'note_revisions') {
return this.getNoteRevision(entityId);
} else if (entityName === 'note_attachments') {
return this.getNoteAttachment(entityId);
} else if (entityName === 'attachments') {
return this.getAttachment(entityId);
}
const camelCaseEntityName = entityName.toLowerCase().replace(/(_[a-z])/g,