mirror of
https://github.com/portainer/portainer.git
synced 2025-07-23 07:19:41 +02:00
18 lines
517 B
TypeScript
18 lines
517 B
TypeScript
import { useQuery } from 'react-query';
|
|
|
|
import { EnvironmentId } from '@/portainer/environments/types';
|
|
|
|
import { getContainers, Filters } from './containers.service';
|
|
|
|
export function useContainers(environmentId: EnvironmentId, filters?: Filters) {
|
|
return useQuery(
|
|
['environments', environmentId, 'docker', 'containers', { filters }],
|
|
() => getContainers(environmentId, filters),
|
|
{
|
|
meta: {
|
|
title: 'Failure',
|
|
message: 'Unable to get containers in network',
|
|
},
|
|
}
|
|
);
|
|
}
|