refactor(stacks): migrate info tab to react [BE-12383] (#1415)

This commit is contained in:
Chaim Lev-Ari
2025-11-25 13:17:26 +02:00
committed by GitHub
parent 0794d0f89f
commit 532575cab5
18 changed files with 1941 additions and 299 deletions
@@ -0,0 +1,30 @@
import { useMutation } from '@tanstack/react-query';
import axios, { parseAxiosError } from '@/portainer/services/axios';
import { buildStackUrl } from '@/react/common/stacks/queries/buildUrl';
import { Stack } from '@/react/common/stacks/types';
export function useStartStackMutation() {
return useMutation({
mutationFn: startStack,
});
}
async function startStack({
id,
environmentId,
}: {
id: Stack['Id'];
environmentId?: number;
}) {
try {
const { data } = await axios.post<Stack>(
buildStackUrl(id, 'start'),
undefined,
{ params: { endpointId: environmentId } }
);
return data;
} catch (e) {
throw parseAxiosError(e, 'Unable to start stack');
}
}