portainer/app/react/common/stacks/queries/buildUrl.ts

8 lines
226 B
TypeScript
Raw Normal View History

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