add: webhook
This commit is contained in:
@@ -2,8 +2,8 @@ import React, {useState} from "react";
|
||||
import { Link } from "react-router-dom";
|
||||
import PermissionGuard from "../PermissionGuard";
|
||||
import "./PathNode.css";
|
||||
import {useDeletePath, useMovePath, usePath, usePaths, useUpdatePath} from "../../utils/path-queries";
|
||||
import {useIndexMarkdown, useMarkdownsByPath, useMoveMarkdown} from "../../utils/markdown-queries";
|
||||
import {useDeletePath, useMovePath, useUpdatePath} from "../../utils/path-queries";
|
||||
import {useIndexMarkdown, useMoveMarkdown} from "../../utils/markdown-queries";
|
||||
import MarkdownNode from "./MarkdownNode";
|
||||
|
||||
const PathNode = ({ path, isRoot = false }) => {
|
||||
@@ -11,12 +11,10 @@ const PathNode = ({ path, isRoot = false }) => {
|
||||
const [isEditing, setIsEditing] = useState(false);
|
||||
const [newName, setNewName] = useState(path.name);
|
||||
|
||||
// const { data: childPaths, isLoading: isChildLoading, error: childError } = usePaths(path.id);
|
||||
// const { data: markdowns, isLoading: isMarkdownLoading, error: markdownError } = useMarkdownsByPath(path.id);
|
||||
const deletePath = useDeletePath();
|
||||
const updatePath = useUpdatePath();
|
||||
|
||||
const {data: indexMarkdown, isLoading: isIndexLoading, error: indexMarkdownError} = useIndexMarkdown(path.id);
|
||||
const {data: indexMarkdown} = useIndexMarkdown(path.id);
|
||||
|
||||
const movePath = useMovePath();
|
||||
const moveMarkdown = useMoveMarkdown();
|
||||
@@ -33,7 +31,7 @@ const PathNode = ({ path, isRoot = false }) => {
|
||||
const handleSave = () => {
|
||||
console.log(`handleSave ${path.id}`);
|
||||
updatePath.mutate({id: path.id, data: {name: newName}}, {
|
||||
onsuccess: () => setIsEditing(false),
|
||||
onSuccess: () => setIsEditing(false),
|
||||
onError: err => alert("failed to update this path"),
|
||||
})
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user