mirror of
https://github.com/zadam/trilium.git
synced 2025-03-01 14:22:32 +01:00
fix undelete attachments
This commit is contained in:
parent
83f19c0537
commit
806062c8d1
@ -15,6 +15,7 @@ const becca = require('../becca/becca');
|
||||
const BBranch = require('../becca/entities/bbranch');
|
||||
const BNote = require('../becca/entities/bnote');
|
||||
const BAttribute = require('../becca/entities/battribute');
|
||||
const BAttachment = require("../becca/entities/battachment");
|
||||
const dayjs = require("dayjs");
|
||||
const htmlSanitizer = require("./html_sanitizer");
|
||||
const ValidationError = require("../errors/validation_error");
|
||||
@ -810,6 +811,16 @@ function undeleteBranch(branchId, deleteId, taskContext) {
|
||||
new BAttribute(attributeRow).save({skipValidation: true});
|
||||
}
|
||||
|
||||
const attachmentRows = sql.getRows(`
|
||||
SELECT * FROM attachments
|
||||
WHERE isDeleted = 1
|
||||
AND deleteId = ?
|
||||
AND ownerId = ?`, [deleteId, noteRow.noteId]);
|
||||
|
||||
for (const attachmentRow of attachmentRows) {
|
||||
new BAttachment(attachmentRow).save();
|
||||
}
|
||||
|
||||
const childBranchIds = sql.getColumn(`
|
||||
SELECT branches.branchId
|
||||
FROM branches
|
||||
|
Loading…
x
Reference in New Issue
Block a user