manage markdowns by path

This commit is contained in:
h z
2024-12-05 18:28:15 +00:00
parent 788fd2f37a
commit da1860a269
12 changed files with 441 additions and 198 deletions

View File

@@ -3,7 +3,7 @@
import React, { useEffect, useState } from "react";
import { useParams } from "react-router-dom";
import {fetchWithCache} from "../utils/fetchWithCache";
import {fetch_} from "../utils/requestUtils";
const MarkdownContent = () => {
const { id } = useParams();
@@ -11,7 +11,10 @@ const MarkdownContent = () => {
const [error, setError] = useState(null);
useEffect(() => {
fetchWithCache(`/api/markdown/${id}`)
fetch_(`/api/markdown/${id}`, {}, {
use_cache: true,
use_token: false
})
.then((data) => setContent(data))
.catch((error) => setError(error));
}, [id]);