2021-04-19 14:09:09 -04:00
|
|
|
import { buildApiUrl } from '~/api/api_utils';
|
2019-11-05 19:06:13 -05:00
|
|
|
import axios from '~/lib/utils/axios_utils';
|
|
|
|
|
2021-04-19 14:09:09 -04:00
|
|
|
const NAMESPACE_EXISTS_PATH = '/api/:version/namespaces/:id/exists';
|
2019-11-05 19:06:13 -05:00
|
|
|
|
2021-11-03 05:10:11 -04:00
|
|
|
export function getGroupPathAvailability(groupPath, parentId, axiosOptions = {}) {
|
2021-04-19 14:09:09 -04:00
|
|
|
const url = buildApiUrl(NAMESPACE_EXISTS_PATH).replace(':id', encodeURIComponent(groupPath));
|
|
|
|
|
|
|
|
return axios.get(url, {
|
2021-11-03 05:10:11 -04:00
|
|
|
params: { parent_id: parentId, ...axiosOptions.params },
|
|
|
|
...axiosOptions,
|
2021-04-19 14:09:09 -04:00
|
|
|
});
|
2019-11-05 19:06:13 -05:00
|
|
|
}
|