Skip to content

Refresh button on instance detail page - #2159

Merged
david-crespo merged 3 commits into
mainfrom
refresh-button
Apr 17, 2024
Merged

david-crespo merged 3 commits into
mainfrom
refresh-button

Conversation

@david-crespo

@david-crespo david-crespo commented Apr 17, 2024 •

Copy link
Copy Markdown
Collaborator

Necessary stopgap until we do more polling. I have some followup work that simulates state changes more fancily in the mock server, which will let us test the button in an e2e.

image

@vercel

vercel Bot commented Apr 17, 2024 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
console ✅ Ready (Inspect) Visit Preview Apr 17, 2024 10:04pm

onSuccess: () => {
queryClient.invalidateQueries('instanceView')
},
onSuccess: refreshData,

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would have missed this if not for reviewing #2157. Serendipity!

Comment thread app/api/hooks.ts
invalidateQueries: <M extends keyof A>(method: M, filters?: InvalidateQueryFilters) =>
queryClient.invalidateQueries({ queryKey: [method], ...filters }),
invalidateQueries: <M extends keyof A>(method?: M, filters?: InvalidateQueryFilters) =>
queryClient.invalidateQueries(method ? { queryKey: [method], ...filters } : undefined),

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I changed the implementation so the ability to nuke all queries isn't necessary anymore, but it's nice to have so I'm just going to leave it in.

@david-crespo
david-crespo merged commit fed9f4d into main Apr 17, 2024
@david-crespo
david-crespo deleted the refresh-button branch April 17, 2024 22:11
@david-crespo david-crespo added this to the 8 milestone Apr 22, 2024

This branch was successfully deployed

1 active deployment
Preview — d99b1cf3 Deployed Apr 17, 2024 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant