1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-19 05:19:39 +02:00
portainer/app/react/docker/configs/queries/useConfigs.ts

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

18 lines
554 B
TypeScript
Raw Normal View History

import { Config } from 'docker-types/generated/1.41';
import axios, { parseAxiosError } from '@/portainer/services/axios';
import { EnvironmentId } from '@/react/portainer/environments/types';
import { buildDockerProxyUrl } from '../../proxy/queries/buildDockerProxyUrl';
export async function getConfigs(environmentId: EnvironmentId) {
try {
const { data } = await axios.get<Config[]>(
buildDockerProxyUrl(environmentId, 'configs')
);
return data;
} catch (e) {
throw parseAxiosError(e, 'Unable to retrieve configs');
}
}