debian-mirror-gitlab/app/assets/javascripts/api/namespaces_api.js

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

14 lines
459 B
JavaScript
Raw Normal View History

2021-04-29 21:17:54 +05:30
import { buildApiUrl } from '~/api/api_utils';
2019-12-26 22:10:19 +05:30
import axios from '~/lib/utils/axios_utils';
2021-04-29 21:17:54 +05:30
const NAMESPACE_EXISTS_PATH = '/api/:version/namespaces/:id/exists';
2019-12-26 22:10:19 +05:30
2021-12-11 22:18:48 +05:30
export function getGroupPathAvailability(groupPath, parentId, axiosOptions = {}) {
2021-04-29 21:17:54 +05:30
const url = buildApiUrl(NAMESPACE_EXISTS_PATH).replace(':id', encodeURIComponent(groupPath));
return axios.get(url, {
2021-12-11 22:18:48 +05:30
params: { parent_id: parentId, ...axiosOptions.params },
...axiosOptions,
2021-04-29 21:17:54 +05:30
});
2019-12-26 22:10:19 +05:30
}