1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-24 07:49:41 +02:00
portainer/app/react/docker/volumes/queries/build-url.ts

19 lines
427 B
TypeScript

import { buildUrl as buildProxyUrl } from '@/react/docker/proxy/queries/build-url';
import { EnvironmentId } from '@/react/portainer/environments/types';
export function buildUrl(
environmentId: EnvironmentId,
{ action, id }: { id?: string; action?: string } = {}
) {
let url = buildProxyUrl(environmentId, 'volumes');
if (id) {
url += `/${id}`;
}
if (action) {
url += `/${action}`;
}
return url;
}