chore(client/lightweight): port tree integration

This commit is contained in:
Elian Doran 2026-01-06 22:59:18 +02:00
parent a6f52fff3e
commit a2d873d16f
No known key found for this signature in database
3 changed files with 7 additions and 6 deletions

View File

@ -61,7 +61,6 @@ import syncApiRoute from "./api/sync.js";
import systemInfoRoute from "./api/system_info.js";
import totp from './api/totp.js';
// API routes
import treeApiRoute from "./api/tree.js";
import { doubleCsrfProtection as csrfMiddleware } from "./csrf_protection.js";
import * as indexRoute from "./index.js";
import loginRoute from "./login.js";
@ -105,6 +104,7 @@ function register(app: express.Application) {
apiRoute(GET, '/api/totp_recovery/enabled', recoveryCodes.checkForRecoveryKeys);
apiRoute(GET, '/api/totp_recovery/used', recoveryCodes.getUsedRecoveryCodes);
const { treeApiRoute } = routes;
apiRoute(GET, '/api/tree', treeApiRoute.getTree);
apiRoute(PST, '/api/tree/load', treeApiRoute.load);

View File

@ -1,10 +1,10 @@
import type { AttributeRow, BranchRow, NoteRow } from "@triliumnext/commons";
import { NotFoundError } from "@triliumnext/core";
import type { Request } from "express";
import becca from "../../becca/becca.js";
import type BNote from "../../becca/entities/bnote.js";
import log from "../../services/log.js";
import { NotFoundError } from "src/errors.js";
import { getLog } from "src/services/log.js";
import type BNote from "src/becca/entities/bnote.js";
function getNotesAndBranchesAndAttributes(_noteIds: string[] | Set<string>) {
const noteIds = new Set(_noteIds);
@ -85,7 +85,7 @@ function getNotesAndBranchesAndAttributes(_noteIds: string[] | Set<string>) {
const branch = becca.branches[branchId];
if (!branch) {
log.error(`Could not find branch for branchId=${branchId}`);
getLog().error(`Could not find branch for branchId=${branchId}`);
continue;
}
@ -105,7 +105,7 @@ function getNotesAndBranchesAndAttributes(_noteIds: string[] | Set<string>) {
const attribute = becca.attributes[attributeId];
if (!attribute) {
log.error(`Could not find attribute for attributeId=${attributeId}`);
getLog().error(`Could not find attribute for attributeId=${attributeId}`);
continue;
}

View File

@ -1 +1,2 @@
export { default as optionsApiRoute } from "./api/options";
export { default as treeApiRoute } from "./api/tree";