fix(rg): proper public count
This commit is contained in:
@@ -129,7 +129,7 @@ export default async function AdminLayout({
|
||||
<SidebarGroupLabel>การตั้งค่า</SidebarGroupLabel>
|
||||
<LimitManager
|
||||
config={config}
|
||||
length={subs.reduce((c, s) => c + (s.paid ? 1 : 0), 0)}
|
||||
length={subs.reduce((c, s) => c + (s.paid && !s.deleted ? 1 : 0), 0)}
|
||||
/>
|
||||
</SidebarGroup>
|
||||
</SidebarFooter>
|
||||
|
||||
+15
-2
@@ -1,6 +1,16 @@
|
||||
"use server";
|
||||
|
||||
import { and, desc, eq, gt, inArray, lt, not, sql } from "drizzle-orm";
|
||||
import {
|
||||
and,
|
||||
count as sqlCount,
|
||||
desc,
|
||||
eq,
|
||||
gt,
|
||||
inArray,
|
||||
lt,
|
||||
not,
|
||||
sql,
|
||||
} from "drizzle-orm";
|
||||
import { revalidatePath } from "next/cache";
|
||||
import { cookies } from "next/headers";
|
||||
import { redirect } from "next/navigation";
|
||||
@@ -155,7 +165,10 @@ export async function getEndgameConfig() {
|
||||
.select()
|
||||
.from(settings)
|
||||
.limit(1);
|
||||
const count = await db.$count(endgameSubmissions);
|
||||
const [{ count }] = await db
|
||||
.select({ count: sqlCount() })
|
||||
.from(endgameSubmissions)
|
||||
.where(not(endgameSubmissions.deleted));
|
||||
const types = await db
|
||||
.select()
|
||||
.from(endgameTypes)
|
||||
|
||||
Reference in New Issue
Block a user