- Added user tracking features to the projects module, including: - Database schema updates to track project creator and assignee. - API enhancements for user management and project filtering by user. - UI components for user assignment in project forms and listings. - New query functions for retrieving users and filtering projects. - Security integration with role-based access and authentication requirements. chore: Create utility scripts for database checks and project testing - Added scripts to check the structure of the projects table. - Created tests for project creation and user tracking functionality. - Implemented API tests to verify project retrieval and user assignment. fix: Update project creation and update functions to include user tracking - Modified createProject and updateProject functions to handle user IDs for creator and assignee. - Ensured that project updates reflect the correct user assignments and timestamps.
28 lines
685 B
JavaScript
28 lines
685 B
JavaScript
import fetch from "node-fetch";
|
|
|
|
async function testProjectAPI() {
|
|
const baseURL = "http://localhost:3000";
|
|
|
|
console.log("Testing project API endpoints...\n");
|
|
|
|
try {
|
|
// Test fetching project 1
|
|
console.log("1. Fetching project 1:");
|
|
const response = await fetch(`${baseURL}/api/projects/1`);
|
|
console.log("Status:", response.status);
|
|
|
|
if (response.ok) {
|
|
const project = await response.json();
|
|
console.log("Project data received:");
|
|
console.log(JSON.stringify(project, null, 2));
|
|
} else {
|
|
const error = await response.text();
|
|
console.log("Error:", error);
|
|
}
|
|
} catch (error) {
|
|
console.error("Error testing API:", error.message);
|
|
}
|
|
}
|
|
|
|
testProjectAPI();
|