diff --git a/apps/web/components/community/index.tsx b/apps/web/components/community/index.tsx index 470175c4..f8caf5b5 100644 --- a/apps/web/components/community/index.tsx +++ b/apps/web/components/community/index.tsx @@ -93,6 +93,7 @@ export function CommunityForum({ const [showDeleteConfirmation, setShowDeleteConfirmation] = useState(false); const [comments, setComments] = useState([]); const { community, loaded } = useCommunity(id); + const [refreshCommunityStatus, setRefreshCommunityStatus] = useState(0); const loadTotalPosts = useCallback(async () => { const query = ` @@ -145,13 +146,13 @@ export function CommunityForum({ try { const response = await fetch.exec(); setMemberStatus(response.communityMembershipStatus); + setRefreshCommunityStatus((prev) => prev + 1); } catch (err: any) { toast({ title: "Error", description: err.message, }); - } finally { - } + } }, [address.backend, id, toast]); const loadPosts = useCallback(async () => { @@ -740,10 +741,11 @@ export function CommunityForum({ /> ) : ( )} diff --git a/apps/web/components/community/membership-status.tsx b/apps/web/components/community/membership-status.tsx index 8c9c3b07..48ae9ac5 100644 --- a/apps/web/components/community/membership-status.tsx +++ b/apps/web/components/community/membership-status.tsx @@ -36,7 +36,6 @@ export default function MembershipStatus({ const { profile } = useContext(ProfileContext); const handleJoinSubmit = async (e: FormEvent) => { - // Handle join request submission e.preventDefault(); const query = ` mutation JoinCommunity( diff --git a/apps/web/models/Membership.ts b/apps/web/models/Membership.ts index d2dc0513..ed02da1e 100644 --- a/apps/web/models/Membership.ts +++ b/apps/web/models/Membership.ts @@ -50,6 +50,8 @@ const MembershipSchema = new mongoose.Schema( default: MembershipStatus.PENDING, }, paymentHistory: [MembershipPaymentSchema], + joiningReason: { type: String }, + rejectionReason: { type: String }, }, { timestamps: true,