web: use new types from core

This commit is contained in:
Abdullah Atta
2023-08-21 16:24:17 +05:00
parent 22221afb7a
commit a881a6d51e
85 changed files with 21768 additions and 753 deletions

View File

@@ -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) {