mirror of
https://github.com/portainer/portainer.git
synced 2025-08-08 23:35:31 +02:00
feat(edge): hide envs from waiting room [EE-5185] (#8688)
This commit is contained in:
parent
4b9c857d85
commit
bbea0bc8a5
2 changed files with 62 additions and 0 deletions
|
@ -0,0 +1,24 @@
|
|||
import { useQueryClient, useMutation } from 'react-query';
|
||||
|
||||
import { promiseSequence } from '@/portainer/helpers/promise-utils';
|
||||
import {
|
||||
mutationOptions,
|
||||
withError,
|
||||
withInvalidate,
|
||||
} from '@/react-tools/react-query';
|
||||
import { EnvironmentId } from '@/react/portainer/environments/types';
|
||||
|
||||
import { deleteEndpoint } from '../environment.service';
|
||||
|
||||
export function useDeleteEnvironmentsMutation() {
|
||||
const queryClient = useQueryClient();
|
||||
|
||||
return useMutation(
|
||||
(ids: Array<EnvironmentId>) =>
|
||||
promiseSequence(ids.map((id) => () => deleteEndpoint(id))),
|
||||
mutationOptions(
|
||||
withError('Failed to remove environments'),
|
||||
withInvalidate(queryClient, [['environments']])
|
||||
)
|
||||
);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue