fix: Page offset on workspace pagination was incorrect (#6693)

* fix: Page offset on workspace pagination was incorrect
This commit is contained in:
Steven Masley
2023-03-22 18:17:49 +00:00
committed by GitHub
parent 1ccbd54ea2
commit 250ee17933
+3 -1
View File
@@ -32,7 +32,9 @@ export const useWorkspacesData = ({
getWorkspaces({
q: query,
limit: limit,
offset: page,
// If the page is <= 0, just use offset 0. This usually happens
// if the page is not provided.
offset: page <= 0 ? 0 : (page - 1) * limit,
}),
refetchInterval: 5_000,
})