refactor: directly use getProjectPathById from projectsDb

This commit is contained in:
Haileyesus
2026-04-29 18:40:21 +03:00
parent 5352582fe5
commit c7d4fa915e
5 changed files with 17 additions and 51 deletions

View File

@@ -2,7 +2,7 @@ import express from 'express';
import { spawn } from 'child_process';
import path from 'path';
import { promises as fs } from 'fs';
import { getProjectPathById } from '../projects.js';
import { projectsDb } from '../modules/database/index.js';
import { queryClaudeSDK } from '../claude-sdk.js';
import { spawnCursor } from '../cursor-cli.js';
@@ -111,7 +111,7 @@ function validateProjectPath(projectPath) {
* by `validateProjectPath` before any `git` command runs against it.
*/
async function getActualProjectPath(projectId) {
const projectPath = await getProjectPathById(projectId);
const projectPath = await projectsDb.getProjectPathById(projectId);
if (!projectPath) {
throw new Error(`Unable to resolve project path for "${projectId}"`);
}

View File

@@ -13,7 +13,7 @@ import fs from 'fs';
import path from 'path';
import { promises as fsPromises } from 'fs';
import { spawn } from 'child_process';
import { getProjectPathById } from '../projects.js';
import { projectsDb } from '../modules/database/index.js';
import { detectTaskMasterMCPServer } from '../utils/mcp-detector.js';
import { broadcastTaskMasterProjectUpdate, broadcastTaskMasterTasksUpdate } from '../utils/taskmaster-websocket.js';
@@ -26,10 +26,10 @@ import { broadcastTaskMasterProjectUpdate, broadcastTaskMasterTasksUpdate } from
* every handler calls this helper and 404s when the id is unknown.
*/
async function resolveProjectPathFromId(projectId) {
if (!projectId) {
return null;
}
return getProjectPathById(projectId);
if (!projectId) {
return null;
}
return projectsDb.getProjectPathById(projectId);
}
const router = express.Router();