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

@@ -19,7 +19,6 @@ import { getConnectableHost } from '../shared/networkHosts.js';
import { findAppRoot, getModuleDir } from './utils/runtime-paths.js';
import {
renameProjectById,
deleteSessionById,
deleteProjectById,
getProjectPathById,
@@ -302,17 +301,6 @@ app.post('/api/system/update', authenticateToken, async (req, res) => {
}
});
// Rename project endpoint; stores the custom name on the DB row for `projectId`.
app.put('/api/projects/:projectId/rename', authenticateToken, async (req, res) => {
try {
const { displayName } = req.body;
await renameProjectById(req.params.projectId, displayName);
res.json({ success: true });
} catch (error) {
res.status(500).json({ error: error.message });
}
});
// Delete session endpoint; resolves `projectId` to path before touching disk.
app.delete('/api/projects/:projectId/sessions/:sessionId', authenticateToken, async (req, res) => {
try {