1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-25 00:09:40 +02:00

refactor(users): migrate list view to react [EE-2202] (#11914)

This commit is contained in:
Chaim Lev-Ari 2024-08-28 14:04:32 -06:00 committed by GitHub
parent 33ce841040
commit 3c1441d462
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
43 changed files with 967 additions and 681 deletions

View file

@ -9,6 +9,10 @@ import {
import { notifyError } from '@/portainer/services/notifications';
/**
* @deprecated use withGlobalError
* `onError` and other callbacks are not supported on react-query v5
*/
export function withError(fallbackMessage?: string, title = 'Failure') {
return {
onError(error: unknown) {
@ -29,7 +33,7 @@ type OptionalReadonly<T> = T | Readonly<T>;
export function withInvalidate(
queryClient: QueryClient,
queryKeysToInvalidate: Array<OptionalReadonly<Array<string | number>>>,
queryKeysToInvalidate: Array<OptionalReadonly<Array<unknown>>>,
// skipRefresh will set the mutation state to success without waiting for the invalidated queries to refresh
// see the following for info: https://tkdodo.eu/blog/mastering-mutations-in-react-query#awaited-promises
{ skipRefresh }: { skipRefresh?: boolean } = {}