Skip to content
Snippets Groups Projects
Commit a76df305 authored by abouchtita's avatar abouchtita
Browse files

Ajout de l'endpoint POST /api/tasks et de la fonction addTask

parent 5c5cc39a
No related branches found
No related tags found
1 merge request!1Develop into main
Pipeline #47831 passed
......@@ -16,7 +16,7 @@ function getAllTasks() {
function addTask(description) {
if (!description) {
throw new Error("La description est requise");
throw new Error('La description est requise');
}
const newId = tasks.reduce((max, task) => task.id > max ? task.id : max, 0) + 1;
const newTask = {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment