refactor: move project rename to module

This commit is contained in:
Haileyesus
2026-04-25 20:28:58 +03:00
parent 3188ef5fee
commit 447f352e7b
4 changed files with 22 additions and 67 deletions

View File

@@ -140,3 +140,11 @@ export async function createProject(
project: mapProjectRowToApiView(projectRow),
};
}
/**
* Sets `projects.custom_project_name` for the given `projectId` (or clears it when empty).
*/
export function updateProjectDisplayName(projectId: string, newDisplayName: unknown): void {
const trimmed = typeof newDisplayName === 'string' ? newDisplayName.trim() : '';
projectsDb.updateCustomProjectNameById(projectId, trimmed.length > 0 ? trimmed : null);
}