debian-mirror-gitlab/app/assets/javascripts/api/namespaces_api.js
2021-12-11 22:18:48 +05:30

13 lines
459 B
JavaScript

import { buildApiUrl } from '~/api/api_utils';
import axios from '~/lib/utils/axios_utils';
const NAMESPACE_EXISTS_PATH = '/api/:version/namespaces/:id/exists';
export function getGroupPathAvailability(groupPath, parentId, axiosOptions = {}) {
const url = buildApiUrl(NAMESPACE_EXISTS_PATH).replace(':id', encodeURIComponent(groupPath));
return axios.get(url, {
params: { parent_id: parentId, ...axiosOptions.params },
...axiosOptions,
});
}