From 61bb142728d957505c72724a0e754b5fa6061a9a Mon Sep 17 00:00:00 2001 From: Shivank Kacker Date: Fri, 2 Feb 2024 00:49:10 +0530 Subject: [PATCH] fixes --- src/app/admin/page.tsx | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/app/admin/page.tsx b/src/app/admin/page.tsx index b8a8f2fe..b832eb99 100644 --- a/src/app/admin/page.tsx +++ b/src/app/admin/page.tsx @@ -8,14 +8,11 @@ import { useEffect, useState } from "react"; export default function Page() { const [isArchived, setIsArchived] = useState(false); - const limit = 10; const projectsQuery = useInfiQuery({ queryKey: ["projects"], - queryFn: ({ pageParam = 1 }) => { - const offset = (pageParam - 1) * limit; + queryFn: ({ pageParam = 0 }) => { return API.projects.list({ - limit: limit, - offset: offset, + offset: pageParam, ordering: "-created_at", archived: isArchived, }); @@ -88,8 +85,8 @@ export default function Page() {