-
Notifications
You must be signed in to change notification settings - Fork 881
chore: simplify workspaces data fetching #17703
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
Conversation
@@ -17,102 +20,99 @@ import { usePopover } from "components/deprecated/Popover/Popover"; | |||
import { linkToTemplate, useLinks } from "modules/navigation"; | |||
import type { FC } from "react"; | |||
import { useQuery } from "react-query"; | |||
|
|||
const Language = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I kinda like the pattern of putting all the language in a constant but it truly doesn't matter haha.
latestVersionId: string; | ||
onUpdateVersion: () => void; | ||
ariaLabel?: string; | ||
workspace: Workspace; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Big fan 😎
limit: 0, | ||
q: `template:${template.name}`, | ||
}); | ||
const { data } = useQuery( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Big fan 😎
We've been using an abstraction that was not necessary to fetch workspaces data. I also took sometime to use the new useWorkspaceUpdate hook in the update workspace tooltip that was missing some important steps like confirmation.