Update server count query to filter by hostServer set to 0 and null to fix pagination

This commit is contained in:
headlessdev 2025-04-19 16:20:59 +02:00
parent ceb10a2ffe
commit 7d49baee6b

View File

@ -42,7 +42,7 @@ export async function POST(request: NextRequest) {
);
const totalHosts = await prisma.server.count({
where: { hostServer: null }
where: { OR: [{ hostServer: 0 }, { hostServer: null }] }
});
const maxPage = Math.ceil(totalHosts / ITEMS_PER_PAGE);