From 5998bbb48449a871d6e6c714eaeb398a7c0e8f53 Mon Sep 17 00:00:00 2001 From: aeroreyna Date: Mon, 21 Feb 2022 22:37:38 -0800 Subject: [PATCH] Fix delete endpoint --- routes/post.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/routes/post.js b/routes/post.js index 42e5b90..8647439 100644 --- a/routes/post.js +++ b/routes/post.js @@ -13,7 +13,7 @@ DB.getDB.then((DB) => { const postBelongToProfile = (post, profileid) => { if(!post) return false; - return post.profileid === profileid; + return post.profileid == profileid; }; const generateNonOrganicPosts = async (req, profileid) => { @@ -204,7 +204,7 @@ DB.getDB.then((DB) => { }); router.delete("/:id", async (req, res) => { - const profileid = getProfileId(req); + const profileid = getProfileId(req) + ''; const postId = req.params.id; const post = await DB.getPost(postId); if(!postBelongToProfile(post, profileid))