mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
fix: Page offset on workspace pagination was incorrect (#6693)
* fix: Page offset on workspace pagination was incorrect
This commit is contained in:
@@ -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,
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user