fix(rg): proper public count
Build and Push Image / build-backend (push) Successful in 5m20s
Build and Push Image / build-frontend (push) Successful in 6m10s
Build and Push Image / push (push) Successful in 5m42s

This commit is contained in:
2026-06-24 13:20:39 +07:00 Unverified
parent 81103af47d
commit 0c03270d66
2 changed files with 16 additions and 3 deletions
+1 -1
View File
@@ -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
View File
@@ -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)