chore(client/lightweight): tree route import not seen

This commit is contained in:
Elian Doran 2026-01-07 11:07:23 +02:00
parent adfe490480
commit 0fe299250e
No known key found for this signature in database
2 changed files with 9 additions and 6 deletions

View File

@ -2,8 +2,6 @@
// This will eventually import your core server and DB provider.
// import { createCoreServer } from "@trilium/core"; (bundled)
import { routes } from '@triliumnext/core';
import BrowserExecutionContext from './lightweight/cls_provider';
import BrowserCryptoProvider from './lightweight/crypto_provider';
import BrowserSqlProvider from './lightweight/sql_provider';
@ -203,14 +201,18 @@ async function dispatch(request: LocalRequest) {
}
// Ensure initialization is complete before accessing routes
await ensureInitialized();
const core = await ensureInitialized();
if (request.method === "GET" && url.pathname === "/api/options") {
return jsonResponse(routes.optionsApiRoute.getOptions());
return jsonResponse(core.routes.optionsApiRoute.getOptions());
}
if (request.method === "GET" && url.pathname === "/api/tree") {
return jsonResponse(routes.treeApiRoute.getTree());
return jsonResponse(core.routes.treeApiRoute.getTree({
query: {
subTreeNoteId: url.searchParams.get("subTreeNoteId") || undefined
}
}));
}
if (url.pathname.startsWith("/api/echo")) {

View File

@ -52,7 +52,8 @@ export { default as Becca } from "./becca/becca-interface";
export type { NotePojo } from "./becca/becca-interface";
export { default as NoteSet } from "./services/search/note_set";
export { default as note_service, NoteParams } from "./services/notes";
export { default as note_service } from "./services/notes";
export type { NoteParams } from "./services/notes";
export * as sanitize from "./services/sanitizer";
export * as routes from "./routes";