(path)
| 6 | * @returns {string} The full API URL. |
| 7 | */ |
| 8 | export const getApiUrl = (path) => { |
| 9 | // Ensure path starts with a single '/' |
| 10 | const formattedPath = path.startsWith('/') ? path : `/${path}`; |
| 11 | return `${API_BASE_URL}${formattedPath}`; |
| 12 | }; |
| 13 | |
| 14 | /** |
| 15 | * Handles API errors by parsing the response and throwing a formatted error. |
no outgoing calls
no test coverage detected