From 0e46de9cda3af4a1ab85a1833a8b2ed8bcd16f46 Mon Sep 17 00:00:00 2001
From: Maximilian Hagelstam
Date: Sun, 11 Aug 2024 10:44:34 +0300
Subject: [PATCH] feat: allows admins to delete all posts
---
src/components/post/post-card.tsx | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/src/components/post/post-card.tsx b/src/components/post/post-card.tsx
index bf6d3f1..d85e714 100644
--- a/src/components/post/post-card.tsx
+++ b/src/components/post/post-card.tsx
@@ -27,6 +27,15 @@ export const PostCard = ({ post, showPinned = false }: PostCardProps) => {
const { t } = useTranslation();
const { data: session } = useSession();
+ const adminUserIds = [
+ "clzo1nl2e0005137e1z9cnajv",
+ "clzlkp5j40000ibxoiwtfhtv4",
+ ];
+
+ const userId = session?.user.id ?? "";
+ const isOwner = userId === post.user.id;
+ const isAdmin = adminUserIds.includes(userId);
+
return (
<>
-
+