mirror of
https://github.com/lemeow125/React-NotesApp.git
synced 2025-04-19 16:31:27 +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 axios from "axios";
|
||||||
import { get } from "http";
|
|
||||||
|
|
||||||
export function GetNotes() {
|
export function GetNotes() {
|
||||||
return fetch("http://localhost:8000/api/v1/notes/").then((res) => {
|
return axios.get("http://localhost:8000/api/v1/notes/").then((res) => {
|
||||||
console.log(res);
|
return res.data;
|
||||||
return res.json();
|
|
||||||
});
|
});
|
||||||
|
/*return fetch("http://localhost:8000/api/v1/notes/").then((res) => {
|
||||||
|
console.log(res.body);
|
||||||
|
return res.json();
|
||||||
|
});*/
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue