This commit is contained in:
anto
2025-01-16 20:38:04 +01:00
parent 51809f460e
commit 4aa36b67b2
3 changed files with 104 additions and 116 deletions

View File

@@ -15,7 +15,9 @@ function display_projects() {
<th>${global_project_list[i].name}</th>
<th>${formatDate(global_project_list[i].start_date)}</th>
<th>${global_project_list[i].status}</th>
<th><button class="project_detail btn btn-primary">détails de ${global_project_list[i].name}</button></th>
<th><button class="project_detail btn btn-primary">détails de ${
global_project_list[i].name
}</button></th>
</tr>`;
}
table.innerHTML = datas;
@@ -30,16 +32,16 @@ function display_projects() {
});
buttons[i].addEventListener("onclick", (event) => {
// Send data to API and then navigate to projet_detail.html page
current_project=change_current_project(i);
current_project = change_current_project(i);
});
}
}
getAllProject()
.then(project_list => {
.then((project_list) => {
global_project_list = project_list;
// Call the next function here
display_projects();
})
.catch(error => {
.catch((error) => {
console.error(error);
});