mirror of
https://github.com/lemeow125/React-NotesApp.git
synced 2024-11-16 22:19:27 +08:00
Polished api and moved from axios to fetch
This commit is contained in:
parent
d96c26bc1a
commit
044f45e038
2 changed files with 7 additions and 3 deletions
|
@ -1,7 +1,9 @@
|
|||
import axios from "axios";
|
||||
import { get } from "http";
|
||||
|
||||
export function GetNotes() {
|
||||
return fetch("http://localhost:8000/api/v1/notes/").then((res) => {
|
||||
const result = res.json();
|
||||
console.log();
|
||||
return result;
|
||||
console.log(res);
|
||||
return res.json();
|
||||
});
|
||||
}
|
||||
|
|
|
@ -2,6 +2,7 @@ import * as React from "react";
|
|||
import styles from "../../styles";
|
||||
import { Button } from "@mui/material";
|
||||
import axios from "axios";
|
||||
import { useQueryClient } from "react-query";
|
||||
|
||||
export interface props {
|
||||
title: string;
|
||||
|
@ -10,6 +11,7 @@ export interface props {
|
|||
date_created: string;
|
||||
}
|
||||
export default function Note(props: props) {
|
||||
const queryClient = useQueryClient();
|
||||
return (
|
||||
<div style={styles.flex_column}>
|
||||
<div style={styles.note}>
|
||||
|
|
Loading…
Reference in a new issue