mirror of
https://github.com/lemeow125/React-NotesApp.git
synced 2024-11-17 06:29:28 +08:00
Move back to axios for api
This commit is contained in:
parent
044f45e038
commit
8153561889
1 changed files with 6 additions and 4 deletions
|
@ -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();
|
||||
});*/
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue