Move back to axios for api

This commit is contained in:
keannu125 2023-02-25 21:41:13 +08:00
parent 044f45e038
commit 8153561889

View file

@ -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();
});*/
}