From 9a9bf88d684a41aa403760769c7dfe99c1a52a02 Mon Sep 17 00:00:00 2001 From: Kaye Ena Crayzhel Misay Date: Fri, 8 Dec 2023 01:34:41 -0700 Subject: [PATCH] feat: update on slashes --- client/src/components/post/MakeCommentModal.tsx | 6 +++++- client/src/components/post/MakePostModal.tsx | 12 ++++++++++++ client/src/components/post/like/CommentLikes.tsx | 4 ++++ client/src/components/post/like/PostLikes.tsx | 4 ++++ client/src/components/post/post-item/PostPage.tsx | 6 +++++- 5 files changed, 30 insertions(+), 2 deletions(-) diff --git a/client/src/components/post/MakeCommentModal.tsx b/client/src/components/post/MakeCommentModal.tsx index 2cc1f38..eb51789 100644 --- a/client/src/components/post/MakeCommentModal.tsx +++ b/client/src/components/post/MakeCommentModal.tsx @@ -193,7 +193,7 @@ const MakeCommentModal = ({ toast.error(ToastMessages.NOUSERCREDS); } } else { - if (post.author.host === Hosts.CODEMONKEYS) { + if (post.author.host === Hosts.CODEMONKEYS || post.author.host === Hosts.TRIET) { data = { ...data, id: `${post.id}/comments/${uuidv4()}`, @@ -262,6 +262,10 @@ const MakeCommentModal = ({ if (post.author.host === Hosts.TRIET) { data = { ...data, + "author": { + ...data.author, + "id": `${data.author.id}/`, + }, "id": `${data.id}/`, } } diff --git a/client/src/components/post/MakePostModal.tsx b/client/src/components/post/MakePostModal.tsx index 1a548ce..04e7bc4 100644 --- a/client/src/components/post/MakePostModal.tsx +++ b/client/src/components/post/MakePostModal.tsx @@ -247,6 +247,10 @@ const MakePostModal = ({ // triet requires / at the end for ids postData = { ...postData, + "author": { + ...postData.author, + "id": `${postData.author.id}/`, + }, "id": `${postData.id}/` } } @@ -279,6 +283,10 @@ const MakePostModal = ({ // triet requires / at the end for ids postData = { ...postData, + "author": { + ...postData.author, + "id": `${postData.author.id}/`, + }, "id": `${postData.id}/` } } @@ -309,6 +317,10 @@ const MakePostModal = ({ // triet requires / at the end for ids postData = { ...postData, + "author": { + ...postData.author, + "id": `${postData.author.id}/`, + }, "id": `${postData.id}/` } } diff --git a/client/src/components/post/like/CommentLikes.tsx b/client/src/components/post/like/CommentLikes.tsx index 8f662b2..28423c4 100644 --- a/client/src/components/post/like/CommentLikes.tsx +++ b/client/src/components/post/like/CommentLikes.tsx @@ -63,6 +63,10 @@ const CommentLikes = ({ if (isObjectFromTriet(authorUrl)) { data = { ...data, + "author": { + ...data.author, + "id": `${data.author.id}/`, + }, "@context": Links.LIKECONTEXT, "object": `${data.object}/`, } diff --git a/client/src/components/post/like/PostLikes.tsx b/client/src/components/post/like/PostLikes.tsx index 24ad7a1..32bb49c 100644 --- a/client/src/components/post/like/PostLikes.tsx +++ b/client/src/components/post/like/PostLikes.tsx @@ -59,6 +59,10 @@ const PostLikes = ({ if (post.author.host === Hosts.TRIET) { data = { ...data, + "author": { + ...data.author, + "id": `${data.author.id}/`, + }, "@context": Links.LIKECONTEXT, "object": `${data.object}/`, } diff --git a/client/src/components/post/post-item/PostPage.tsx b/client/src/components/post/post-item/PostPage.tsx index 000c961..74d47a7 100644 --- a/client/src/components/post/post-item/PostPage.tsx +++ b/client/src/components/post/post-item/PostPage.tsx @@ -249,7 +249,7 @@ const PostPage = () => { toast.error(ToastMessages.NOUSERCREDS); } } else { - if (post.author.host === Hosts.CODEMONKEYS) { + if (post.author.host === Hosts.CODEMONKEYS || post.author.host === Hosts.TRIET) { data = { ...data, id: `${post.id}/comments/${uuidv4()}`, @@ -318,6 +318,10 @@ const PostPage = () => { if (postHost === Hosts.TRIET) { data = { ...data, + "author": { + ...data.author, + "id": `${data.author.id}/`, + }, "id": `${data.id}/`, } }