Skip to content

Commit

Permalink
Merge pull request #44 from jtomasek/urls-fix
Browse files Browse the repository at this point in the history
Fix saveAs URLs
  • Loading branch information
rawagner authored Jun 24, 2020
2 parents 94ecd4e + df47e13 commit 80f72d5
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/api/clusters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,17 @@ export const createClusterDownloadsImage = (
axiosOptions: AxiosRequestConfig,
): AxiosPromise<void> => client.post(`/clusters/${id}/downloads/image`, params, axiosOptions);

// TODO(jtomasek): make the API_ROOT configurable so this can be used in cloud.redhat.com
const API_ROOT = process.env.REACT_APP_API_ROOT;

export const getClusterDownloadsImageUrl = (clusterId: string) =>
`/clusters/${clusterId}/downloads/image`;
`${API_ROOT}/clusters/${clusterId}/downloads/image`;

export const getClusterFileURL = (clusterID: string, fileName: string) =>
`/clusters/${clusterID}/downloads/files?file_name=${fileName}`;
`${API_ROOT}/clusters/${clusterID}/downloads/files?file_name=${fileName}`;

export const getClusterKubeconfigURL = (clusterID: string) =>
`/clusters/${clusterID}/downloads/kubeconfig`;
`${API_ROOT}/clusters/${clusterID}/downloads/kubeconfig`;

export const getClusterCredentials = (clusterID: string): AxiosPromise<Credentials> =>
client.get(`/clusters/${clusterID}/credentials`);

0 comments on commit 80f72d5

Please sign in to comment.