@hasna/conversations 0.1.20 → 0.1.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/index.js +290 -272
- package/bin/mcp.js +256 -266
- package/dist/index.js +6 -5
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2821,10 +2821,6 @@ function getProjectByName(name) {
|
|
|
2821
2821
|
}
|
|
2822
2822
|
function updateProject(id, updates) {
|
|
2823
2823
|
const db2 = getDb();
|
|
2824
|
-
const existing = db2.prepare("SELECT * FROM projects WHERE id = ?").get(id);
|
|
2825
|
-
if (!existing) {
|
|
2826
|
-
throw new Error(`Project not found: ${id}`);
|
|
2827
|
-
}
|
|
2828
2824
|
const sets = [];
|
|
2829
2825
|
const params = [];
|
|
2830
2826
|
if (updates.name !== undefined) {
|
|
@@ -2860,10 +2856,15 @@ function updateProject(id, updates) {
|
|
|
2860
2856
|
params.push(JSON.stringify(updates.settings));
|
|
2861
2857
|
}
|
|
2862
2858
|
if (sets.length === 0) {
|
|
2863
|
-
|
|
2859
|
+
const row2 = db2.prepare("SELECT * FROM projects WHERE id = ?").get(id);
|
|
2860
|
+
if (!row2)
|
|
2861
|
+
throw new Error(`Project not found: ${id}`);
|
|
2862
|
+
return parseProject(row2);
|
|
2864
2863
|
}
|
|
2865
2864
|
params.push(id);
|
|
2866
2865
|
const row = db2.prepare(`UPDATE projects SET ${sets.join(", ")} WHERE id = ? RETURNING *`).get(...params);
|
|
2866
|
+
if (!row)
|
|
2867
|
+
throw new Error(`Project not found: ${id}`);
|
|
2867
2868
|
return parseProject(row);
|
|
2868
2869
|
}
|
|
2869
2870
|
function deleteProject(id) {
|