MCPcopy
hub / github.com/Zleap-AI/SAG / renameProject

Function renameProject

web/src/App.tsx:481–494  ·  view source on GitHub ↗
(project: SourceRecord, name: string)

Source from the content-addressed store, hash-verified

479 }
480
481 async function renameProject(project: SourceRecord, name: string) {
482 const nextName = name.trim();
483 if (!nextName || nextName === project.name) return false;
484 setError("");
485 try {
486 await api.updateProject(project.id, { name: nextName });
487 await loadProjects();
488 setStatus(t(`已重命名项目为「${nextName}」。`, `Project renamed to "${nextName}".`));
489 return true;
490 } catch (err) {
491 setError(getErrorMessage(err));
492 return false;
493 }
494 }
495
496 async function archiveOrRestoreProject(project: SourceRecord) {
497 const confirmText = project.archivedAt

Callers

nothing calls this directly

Calls 4

loadProjectsFunction · 0.85
tFunction · 0.85
updateProjectMethod · 0.80
getErrorMessageFunction · 0.70

Tested by

no test coverage detected