note revision sync fix

This commit is contained in:
zadam
2019-11-09 16:51:51 +01:00
parent da92809299
commit 179d530ea9
5 changed files with 21 additions and 14 deletions

View File

@@ -255,6 +255,7 @@ const primaryKeys = {
"note_contents": "noteId",
"branches": "branchId",
"note_revisions": "noteRevisionId",
"note_revision_contents": "noteRevisionId",
"recent_notes": "noteId",
"api_tokens": "apiTokenId",
"options": "name",
@@ -278,7 +279,7 @@ async function getEntityRow(entityName, entityId) {
throw new Error(`Entity ${entityName} ${entityId} not found.`);
}
if (['note_contents', 'note_revisions'].includes(entityName) && entity.content !== null) {
if (['note_contents', 'note_revision_contents'].includes(entityName) && entity.content !== null) {
if (typeof entity.content === 'string') {
entity.content = Buffer.from(entity.content, 'UTF-8');
}