Adding tasks now works v0.0.17
This commit is contained in:
parent
eb919708d2
commit
e12ccd9129
@ -37,7 +37,7 @@ addTaskBtn.addEventListener("click", function() {
|
||||
|
||||
const newTaskPromise = newTask(taskName, taskDescription, token);
|
||||
newTaskPromise.then((res) => res.json()).then((json => {
|
||||
console.log(json);
|
||||
window.location.reload();
|
||||
}))
|
||||
})
|
||||
});
|
||||
@ -160,14 +160,14 @@ const updateTask = (userToken, taskTitle, taskDescription, completedStatus) => {
|
||||
return res;
|
||||
}
|
||||
|
||||
const newTask = (name, description, userToken) => {
|
||||
const newTask = (title, description, userToken) => {
|
||||
const res = fetch(`${url}/user/update-tasks`, {
|
||||
method: "PATCH",
|
||||
headers: {Authorization: `Bearer ${userToken}`, "Content-Type": "application/json"},
|
||||
body: JSON.stringify({
|
||||
name: name,
|
||||
description: description,
|
||||
is_completed: false
|
||||
"title": title,
|
||||
"description": description,
|
||||
"is_completed": false
|
||||
})
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user