sql injection in search

This commit is contained in:
Florian Hoss 2022-04-07 21:06:30 +02:00
parent 7786e839b0
commit 4a07b461d3
3 changed files with 20 additions and 17 deletions

View file

@ -47,10 +47,10 @@
const enteredText = e.currentTarget.value;
clearTimeout(timer);
if (e.key === "Enter ") {
searchTask(enteredText);
getAllTasks(enteredText);
} else {
timer = setTimeout(() => {
searchTask(enteredText);
getAllTasks(enteredText);
}, 1000);
}
});
@ -84,12 +84,6 @@
});
}
function searchTask(value) {
if (value !== "") {
console.log(value);
}
}
function addTaskToTasks(task, number) {
tasks.push(task);
const newTask = document.createElement('div');
@ -119,10 +113,10 @@
tasksEl.appendChild(taskHeader);
}
function getAllTasks() {
function getAllTasks(filter) {
tasksEl.innerHTML = "";
addTaskHeader();
axios.get("/tasks", axiosConfig).then((response) => {
axios.get("/tasks", {params: {filter: filter}, headers: {username: username}}).then((response) => {
tasks = response.data.tasks;
tasks.forEach((task, index) => {
addTaskToTasks(task, index + 1);