Skip to content

chore(site): Use react-query and refactor the workspaces page to use it #5838

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Jan 24, 2023
Prev Previous commit
Next Next commit
Remove unused func
  • Loading branch information
BrunoQuaresma committed Jan 24, 2023
commit 8cf28a644e9420d20f2522d82fb946f6e5e5139c
6 changes: 1 addition & 5 deletions site/src/pages/WorkspacesPage/data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@ import {
WorkspacesResponse,
} from "api/typesGenerated"

const getQueryKey = (page: number, query: string) => {
return ["workspaces", query, page]
}

type UseWorkspacesDataParams = {
page: number
limit: number
Expand All @@ -26,7 +22,7 @@ export const useWorkspacesData = ({
limit,
query,
}: UseWorkspacesDataParams) => {
const queryKey = getQueryKey(page, query)
const queryKey = ["workspaces", query, page]
const result = useQuery({
queryKey,
queryFn: () =>
Expand Down