Fixed public notes api

This commit is contained in:
keannu125 2023-03-29 20:32:05 +08:00
parent aaa5f8b64b
commit fc7488f8aa
4 changed files with 5 additions and 11 deletions

View file

@ -28,15 +28,9 @@ export function GetNotes() {
export function GetPublicNotes() {
const token = JSON.parse(localStorage.getItem("token") || "{}");
return instance
.get("/api/v1/public_notes/", {
headers: {
Authorization: "Token " + token,
},
})
.then((response) => {
return response.data;
});
return instance.get("/api/v1/public_notes/").then((response) => {
return response.data;
});
}
export function GetNote(id: number) {

View file

@ -5,7 +5,7 @@ import { Button } from "@mui/material";
import { useQuery } from "react-query";
import { GetPublicNotes } from "../Api/Api";
import { NoteProps } from "../../Interfaces/Interfaces";
import PublicNote from "../PublicNote/Note";
import PublicNote from "../PublicNote/PublicNote";
export default function PublicNotes() {
const navigate = useNavigate();

View file

@ -3,7 +3,7 @@ import { useState } from "react";
import styles from "../../styles";
import { Switch } from "@mui/material";
import Notes from "../Notes/Notes";
import PublicNotes from "../PublicNotes/Notes";
import PublicNotes from "../PublicNotes/PublicNotes";
export default function ViewToggle() {
const [switchLabel, setLabel] = useState("Viewing public notes");