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:
parent
33ce841040
commit
3c1441d462
43 changed files with 967 additions and 681 deletions
|
@ -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 } = {}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue