diff --git a/public/index.html b/public/index.html index 6a317ee..8bed4a7 100644 --- a/public/index.html +++ b/public/index.html @@ -28,7 +28,9 @@

Create Project - + + +
diff --git a/public/js/main.js b/public/js/main.js index 92fac12..c8f127a 100644 --- a/public/js/main.js +++ b/public/js/main.js @@ -82,6 +82,12 @@ function createTask() { const description = document.getElementById('newTaskDescription').value; const projectId = document.getElementById('projectIdField').value; + // Log the data being sent to the server + console.log("Creating task with the following data:"); + console.log("Title:", title); + console.log("Description:", description); + console.log("Project ID:", projectId); + fetch(`/tasks`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, @@ -121,6 +127,7 @@ function attachProjectClickHandlers() { document.querySelectorAll('.project-link').forEach(projectLink => { projectLink.addEventListener('click', function(event) { event.preventDefault(); + console.log("Clicked project ID:", this.getAttribute('data-projectid')); currentProjectId = this.getAttribute('data-projectid'); fetchTasksForProject(currentProjectId); showCreateTaskForm(); diff --git a/views/projects.pug b/views/projects.pug index 6ee9fbe..9f28ab0 100644 --- a/views/projects.pug +++ b/views/projects.pug @@ -5,6 +5,6 @@ block content ul each project in projects li - a(href=`/projects/${project._id}`) #{project.name} + a(href=`/projects/${project._id}`, data-projectid=project._id) #{project.name} p #{project.description} a(href="/projects/new") Add New Project