mirror of
https://github.com/zadam/trilium.git
synced 2025-11-17 02:30:42 +01:00
Address code review feedback - add logging and constant for virtual branches
Co-authored-by: eliandoran <21236836+eliandoran@users.noreply.github.com>
This commit is contained in:
@@ -278,18 +278,22 @@ function setPrefixBatch(req: Request) {
|
||||
}
|
||||
|
||||
const normalizedPrefix = utils.isEmptyOrWhitespace(prefix) ? null : prefix;
|
||||
let updatedCount = 0;
|
||||
|
||||
for (const branchId of branchIds) {
|
||||
const branch = becca.getBranch(branchId);
|
||||
if (branch) {
|
||||
branch.prefix = normalizedPrefix;
|
||||
branch.save();
|
||||
updatedCount++;
|
||||
} else {
|
||||
log.info(`Branch ${branchId} not found, skipping prefix update`);
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
success: true,
|
||||
count: branchIds.length
|
||||
count: updatedCount
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user