1
0
Fork 0
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:
Chaim Lev-Ari 2023-04-27 09:23:10 +07:00 committed by GitHub
parent 4b9c857d85
commit bbea0bc8a5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 62 additions and 0 deletions

View file

@ -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']])
)
);
}