From 5d683721b163940564a134dabcc3fbda0d7f3cde Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Sat, 17 Feb 2024 23:32:32 +0200 Subject: [PATCH] server-ts: Change data type --- src/becca/becca_loader.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/becca/becca_loader.ts b/src/becca/becca_loader.ts index 23ee9fdd3..f49436292 100644 --- a/src/becca/becca_loader.ts +++ b/src/becca/becca_loader.ts @@ -39,9 +39,9 @@ function load() { new BNote().update(row).init(); } - const branchRows = sql.getRawRows<{ notePosition: number}>(`SELECT branchId, noteId, parentNoteId, prefix, notePosition, isExpanded, utcDateModified FROM branches WHERE isDeleted = 0`); + const branchRows = sql.getRawRows(`SELECT branchId, noteId, parentNoteId, prefix, notePosition, isExpanded, utcDateModified FROM branches WHERE isDeleted = 0`); // in-memory sort is faster than in the DB - branchRows.sort((a, b) => a.notePosition - b.notePosition); + branchRows.sort((a, b) => (a.notePosition || 0) - (b.notePosition || 0)); for (const row of branchRows) { new BBranch().update(row).init();