core: export with empty content if no content found

This commit is contained in:
Abdullah Atta
2023-06-26 12:30:56 +05:00
committed by Abdullah Atta
parent e138aef6a9
commit 1fb43b7dfe

View File

@@ -30,7 +30,7 @@ export default class Note {
/**
*
* @param {import('../api').default} db
* @param {Object} note
* @param {any} note
*/
constructor(note, db) {
this._note = note;
@@ -97,9 +97,11 @@ export default class Note {
createdOn: formatDate(this.data.dateCreated),
tags: this.tags.join(", ")
};
contentItem =
contentItem || (await this._db.content.raw(this._note.contentId));
if (!contentItem) return false;
contentItem = contentItem ||
(await this._db.content.raw(this._note.contentId)) || {
type: "tiptap",
data: "<p></p>"
};
const { data, type } = await this._db.content.downloadMedia(
`export-${this.id}`,
contentItem,