mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-23 15:09:33 +01:00
web: use new types from core
This commit is contained in:
@@ -17,7 +17,7 @@ You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import Note from "@notesnook/core/dist/models/note";
|
||||
import { Note } from "@notesnook/core/dist/types";
|
||||
import { db } from "../../common/db";
|
||||
import { exportNote } from "../../common/export";
|
||||
import { makeUniqueFilename } from "./utils";
|
||||
@@ -47,7 +47,9 @@ export class ExportStream extends TransformStream<Note, ZipFile> {
|
||||
|
||||
const notebooks = [
|
||||
...(
|
||||
db.relations?.to({ id: note.id, type: "note" }, "notebook") || []
|
||||
db.relations
|
||||
?.to({ id: note.id, type: "note" }, "notebook")
|
||||
.resolved() || []
|
||||
).map((n) => ({ title: n.title, topics: [] })),
|
||||
...(note.notebooks || []).map(
|
||||
(ref: { id: string; topics: string[] }) => {
|
||||
@@ -83,8 +85,8 @@ export class ExportStream extends TransformStream<Note, ZipFile> {
|
||||
controller.enqueue({
|
||||
path: makeUniqueFilename(filePath, counters),
|
||||
data: content,
|
||||
mtime: new Date(note.data.dateEdited),
|
||||
ctime: new Date(note.data.dateCreated)
|
||||
mtime: new Date(note.dateEdited),
|
||||
ctime: new Date(note.dateCreated)
|
||||
});
|
||||
});
|
||||
} catch (e) {
|
||||
|
||||
Reference in New Issue
Block a user