feat: Add schema check and logging tests for project tasks and notes
This commit is contained in:
@@ -20,11 +20,9 @@ export function getNotesByTaskId(task_id) {
|
||||
}
|
||||
|
||||
export function addNoteToTask(task_id, note, is_system = false) {
|
||||
db.prepare(`INSERT INTO notes (task_id, note, is_system) VALUES (?, ?, ?)`).run(
|
||||
task_id,
|
||||
note,
|
||||
is_system ? 1 : 0
|
||||
);
|
||||
db.prepare(
|
||||
`INSERT INTO notes (task_id, note, is_system) VALUES (?, ?, ?)`
|
||||
).run(task_id, note, is_system ? 1 : 0);
|
||||
}
|
||||
|
||||
export function deleteNote(note_id) {
|
||||
|
||||
@@ -62,7 +62,7 @@ export function getProjectTasks(projectId) {
|
||||
export function createProjectTask(data) {
|
||||
let result;
|
||||
let taskName;
|
||||
|
||||
|
||||
if (data.task_template_id) {
|
||||
// Creating from template - explicitly set custom_max_wait_days to NULL so COALESCE uses template value
|
||||
const stmt = db.prepare(`
|
||||
@@ -75,7 +75,7 @@ export function createProjectTask(data) {
|
||||
data.status || "pending",
|
||||
data.priority || "normal"
|
||||
);
|
||||
|
||||
|
||||
// Get the template name for the log
|
||||
const templateStmt = db.prepare("SELECT name FROM tasks WHERE task_id = ?");
|
||||
const template = templateStmt.get(data.task_template_id);
|
||||
@@ -94,7 +94,7 @@ export function createProjectTask(data) {
|
||||
data.status || "pending",
|
||||
data.priority || "normal"
|
||||
);
|
||||
|
||||
|
||||
taskName = data.custom_task_name;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user