diff options
Diffstat (limited to 'gui/src/components/post')
| -rw-r--r-- | gui/src/components/post/Footer.tsx | 32 | ||||
| -rw-r--r-- | gui/src/components/post/Header.tsx | 1 |
2 files changed, 7 insertions, 26 deletions
diff --git a/gui/src/components/post/Footer.tsx b/gui/src/components/post/Footer.tsx index a87c1f8..87f45f3 100644 --- a/gui/src/components/post/Footer.tsx +++ b/gui/src/components/post/Footer.tsx @@ -51,7 +51,7 @@ function Footer({ poast, refetch }: PostProps) { async function cancelRP(e: React.MouseEvent) { e.stopPropagation(); e.preventDefault(); - const r = await api!.deletePost(our); + const r = await api!.deletePost(poast.host, poast.id); if (r) toast.success("Repost deleted"); // refetch(); if (location.includes(poast.id)) navigate("/"); @@ -60,31 +60,11 @@ function Footer({ poast, refetch }: PostProps) { // TODO update backend because contents are only markdown now e.stopPropagation(); e.preventDefault(); - // const c = [ - // { - // ref: { - // type: "trill", - // ship: poast.host, - // path: `/${poast.id}`, - // }, - // }, - // ]; - // const post: SentPoast = { - // host: our, - // author: our, - // thread: null, - // parent: null, - // contents: input, - // read: openLock, - // write: openLock, - // tags: [], // TODO - // }; - // const r = await api!.addPost(post, false); - // setReposting(true); - // if (r) { - // setReposting(false); - // toast.success("Your post was published"); - // } + const pid = { ship: poast.host, id: poast.id }; + const r = await api!.addRP(pid); + if (r) { + toast.success("Your repost was published"); + } } function doReact(e: React.MouseEvent) { e.stopPropagation(); diff --git a/gui/src/components/post/Header.tsx b/gui/src/components/post/Header.tsx index 4e72fe8..0dfd5e4 100644 --- a/gui/src/components/post/Header.tsx +++ b/gui/src/components/post/Header.tsx @@ -10,6 +10,7 @@ function Header(props: PostProps) { // console.log(props.poast.author.length, "length"); function go(e: React.MouseEvent) { e.stopPropagation(); + navigate(`/feed/${poast.host}`); } function openThread(e: React.MouseEvent) { e.stopPropagation(); |
