1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-23 23:39:41 +02:00
portainer/app/react/edge/edge-groups/queries/build-url.ts

10 lines
264 B
TypeScript

import { EdgeGroup } from '../types';
export function buildUrl({
action,
id,
}: { id?: EdgeGroup['Id']; action?: string } = {}) {
const baseUrl = '/edge_groups';
const url = id ? `${baseUrl}/${id}` : baseUrl;
return action ? `${url}/${action}` : url;
}