fix: edit function of markdown
This commit is contained in:
@@ -8,7 +8,7 @@ import { fetch_ } from "../../utils/requestUtils";
|
||||
const PathNode = ({ path, isRoot = false, onDelete, onSave }) => {
|
||||
const [children, setChildren] = useState([]);
|
||||
const [markdowns, setMarkdowns] = useState([]);
|
||||
const [isExpanded, setIsExpanded] = useState(isRoot); // Root is always expanded
|
||||
const [isExpanded, setIsExpanded] = useState(isRoot);
|
||||
const [loading, setLoading] = useState(false);
|
||||
const [isEditing, setIsEditing] = useState(false);
|
||||
const [newName, setNewName] = useState(path.name);
|
||||
@@ -18,13 +18,9 @@ const PathNode = ({ path, isRoot = false, onDelete, onSave }) => {
|
||||
fetch_(`${config.BACKEND_HOST}/api/markdown/get_index/${path.id}`, {}, {
|
||||
use_cache: true,
|
||||
use_token: false
|
||||
}).then((data) => {
|
||||
setIndexMarkdownId(data.id);
|
||||
})
|
||||
.catch((error) => {
|
||||
setIndexMarkdownId(null);
|
||||
console.error(error);
|
||||
});
|
||||
.then((data) => setIndexMarkdownId(data.id))
|
||||
.catch((error) => setIndexMarkdownId(null) );
|
||||
}, [path]);
|
||||
|
||||
const handleSave = () => {
|
||||
|
||||
Reference in New Issue
Block a user