From 952081e35adc98c4586c78e4a7cde9c4f7838182 Mon Sep 17 00:00:00 2001 From: prasanth7890 <59390943+prasanth7890@users.noreply.github.com> Date: Tue, 11 Jul 2023 22:02:17 +0530 Subject: [PATCH] Update edit-task.js The issue TypeError: 'Task' is not found - is resolved. Because there is no object inside the 'data' object and we are trying to access it. so the required object is not inside the 'data' but the data itself. --- 03-task-manager/starter/public/edit-task.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/03-task-manager/starter/public/edit-task.js b/03-task-manager/starter/public/edit-task.js index 3bd0eed24..b7a85f76d 100644 --- a/03-task-manager/starter/public/edit-task.js +++ b/03-task-manager/starter/public/edit-task.js @@ -11,9 +11,9 @@ let tempName const showTask = async () => { try { const { - data: { task }, + data } = await axios.get(`/api/v1/tasks/${id}`) - const { _id: taskID, completed, name } = task + const { _id: taskID, completed, name } = data taskIDDOM.textContent = taskID taskNameDOM.value = name