From 81535618895d0d5bdec21dfcd7d02796273834ec Mon Sep 17 00:00:00 2001 From: keannu125 Date: Sat, 25 Feb 2023 21:41:13 +0800 Subject: [PATCH] Move back to axios for api --- src/Components/Api/Api.tsx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/Components/Api/Api.tsx b/src/Components/Api/Api.tsx index 4a71e0e..52d06c3 100644 --- a/src/Components/Api/Api.tsx +++ b/src/Components/Api/Api.tsx @@ -1,9 +1,11 @@ import axios from "axios"; -import { get } from "http"; export function GetNotes() { - return fetch("http://localhost:8000/api/v1/notes/").then((res) => { - console.log(res); - return res.json(); + return axios.get("http://localhost:8000/api/v1/notes/").then((res) => { + return res.data; }); + /*return fetch("http://localhost:8000/api/v1/notes/").then((res) => { + console.log(res.body); + return res.json(); + });*/ }