From 1a2785d9abf735e7d3b0aae73e7636d3c18e7929 Mon Sep 17 00:00:00 2001 From: TheExGenesis Date: Wed, 4 Sep 2024 03:41:45 -0400 Subject: [PATCH] fix: community stats table name --- src/components/CommunityStats.tsx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/components/CommunityStats.tsx b/src/components/CommunityStats.tsx index 0dec62d..6759525 100644 --- a/src/components/CommunityStats.tsx +++ b/src/components/CommunityStats.tsx @@ -1,23 +1,23 @@ import React, { useEffect, useState } from 'react' import { createBrowserClient } from '@/utils/supabase' -import { getSchemaName, getTableName } from '@/lib-client/getTableName' +import { getSchemaName } from '@/lib-client/getTableName' const getStats = async (supabase: any) => { const [accountsResult, tweetsResult, likedTweetsResult] = await Promise.all([ supabase .schema(getSchemaName()) - .from(getTableName('account')) + .from('account') .select(`username`) .order('created_at', { ascending: false }), supabase .schema(getSchemaName()) - .from(getTableName('tweets')) + .from('tweets') .select('tweet_id', { count: 'exact', head: true }), supabase .schema(getSchemaName()) - .from(getTableName('liked_tweets')) + .from('liked_tweets') .select('tweet_id', { count: 'exact', head: true }), ]) @@ -33,6 +33,8 @@ const getStats = async (supabase: any) => { throw accountsError || tweetsError || likedTweetsError } + console.log('accounts', accounts) + return { usernames: accounts.map((account: any) => account.username), accountCount: accounts.length,