MCPcopy Create free account
hub / github.com/bytebase/bytebase / moveFolder

Function moveFolder

frontend/src/views/sql-editor/Sheet/context.ts:481–495  ·  view source on GitHub ↗
(from, to)

Source from the content-addressed store, hash-verified

479 persistViewFolders(view, next);
480 },
481 moveFolder(from, to) {
482 const fromPath = ensureFolderPath(view, from);
483 const toPath = ensureFolderPath(view, to);
484 const current = useSheetContextStore.getState().viewStates[view].folders;
485 const next = current.map((path) => {
486 if (path === fromPath) return toPath;
487 if (isSubFolder({ parent: fromPath, path, dig: true })) {
488 return path.replace(fromPath, toPath);
489 }
490 return path;
491 });
492 const deduped = sortBy([...new Set(next)]);
493 useSheetContextStore.getState().setViewFolders(view, deduped);
494 persistViewFolders(view, deduped);
495 },
496 mergeFolders(paths) {
497 const current = useSheetContextStore.getState().viewStates[view].folders;
498 const set = new Set(current);

Callers

nothing calls this directly

Calls 3

isSubFolderFunction · 0.90
ensureFolderPathFunction · 0.85
persistViewFoldersFunction · 0.85

Tested by

no test coverage detected