(sourceAlias, destinationRelativePath)
| 114 | * @returns {Promise<object>} - API response. |
| 115 | */ |
| 116 | export const duplicateConfig = async (sourceAlias, destinationRelativePath) => { |
| 117 | const url = getApiUrl('/configs/duplicate'); |
| 118 | const response = await fetch(url, { |
| 119 | method: 'POST', |
| 120 | headers: { 'Content-Type': 'application/json' }, |
| 121 | body: JSON.stringify({ |
| 122 | source_alias: sourceAlias, |
| 123 | destination_relative_path: destinationRelativePath, |
| 124 | }), |
| 125 | }); |
| 126 | // Use handleApiResponse which includes error handling |
| 127 | return handleApiResponse(response); |
| 128 | }; |
| 129 | |
| 130 | /** |
| 131 | * Fetches available config aliases (e.g., from super_config.yaml) that can be used as sources for duplication. |
no test coverage detected