diff --git a/.github/pull_request_template.md b/.github/ISSUE_TEMPLATE/pull_request_template.md similarity index 100% rename from .github/pull_request_template.md rename to .github/ISSUE_TEMPLATE/pull_request_template.md diff --git a/Web-Week3-React b/Web-Week3-React new file mode 160000 index 0000000..0cf878b --- /dev/null +++ b/Web-Week3-React @@ -0,0 +1 @@ +Subproject commit 0cf878b122cdbc331d3d9688a219b4f7f2206ce3 diff --git a/components/AddTask.js b/components/AddTask.js index 8b8177f..5fc0e21 100644 --- a/components/AddTask.js +++ b/components/AddTask.js @@ -1,5 +1,34 @@ +import React, {useState} from "react"; + + export default function AddTask() { + const[task,settask]=useState(""); const addTask = () => { + + + function handlechange(event){ + newvalue=event.target.value; + settask(newvalue); + + } + + // Make API request to add the task + axiosInstance + .post("tasks/", { task: task }) + .then((response) => { + + const newTask = response.data; + + + + + settask(""); + }) + .catch((error) => { + + console.error(error); + }); + /** * @todo Complete this function. * @todo 1. Send the request to add the task to the backend server. @@ -10,6 +39,7 @@ export default function AddTask() { return (