diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-01-14 18:10:46 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-01-14 18:10:46 +0300 |
commit | 8106ac487c3b52471e2ca894c65c13162c2fb1a8 (patch) | |
tree | 12a07c7dd794babe870477f3cd42f15392a82355 /app/assets/javascripts/api.js | |
parent | 18873553de98259d0558157f78198b38ddd02b31 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/api.js')
-rw-r--r-- | app/assets/javascripts/api.js | 40 |
1 files changed, 38 insertions, 2 deletions
diff --git a/app/assets/javascripts/api.js b/app/assets/javascripts/api.js index 2f3a56ec046..e0b9643f509 100644 --- a/app/assets/javascripts/api.js +++ b/app/assets/javascripts/api.js @@ -5,6 +5,12 @@ import { __ } from '~/locale'; const DEFAULT_PER_PAGE = 20; +/** + * Slow deprecation Notice: Please rather use for new calls + * or during refactors /rest_api as this is doing named exports + * which support treeshaking + */ + const Api = { DEFAULT_PER_PAGE, groupsPath: '/api/:version/groups.json', @@ -152,7 +158,10 @@ const Api = { }); }, - // Return groups list. Filtered by query + /** + * @deprecated This method will be removed soon. Use the + * `getGroups` method in `~/rest_api` instead. + */ groups(query, options, callback = () => {}) { const url = Api.buildUrl(Api.groupsPath); return axios @@ -188,7 +197,10 @@ const Api = { .then(({ data }) => callback(data)); }, - // Return projects list. Filtered by query + /** + * @deprecated This method will be removed soon. Use the + * `getProjects` method in `~/rest_api` instead. + */ projects(query, options, callback = () => {}) { const url = Api.buildUrl(Api.projectsPath); const defaults = { @@ -521,6 +533,10 @@ const Api = { .replace(':namespace_path', namespacePath); }, + /** + * @deprecated This method will be removed soon. Use the + * `getUsers` method in `~/rest_api` instead. + */ users(query, options) { const url = Api.buildUrl(this.usersPath); return axios.get(url, { @@ -532,6 +548,10 @@ const Api = { }); }, + /** + * @deprecated This method will be removed soon. Use the + * `getUser` method in `~/rest_api` instead. + */ user(id, options) { const url = Api.buildUrl(this.userPath).replace(':id', encodeURIComponent(id)); return axios.get(url, { @@ -539,11 +559,19 @@ const Api = { }); }, + /** + * @deprecated This method will be removed soon. Use the + * `getUserCounts` method in `~/rest_api` instead. + */ userCounts() { const url = Api.buildUrl(this.userCountsPath); return axios.get(url); }, + /** + * @deprecated This method will be removed soon. Use the + * `getUserStatus` method in `~/rest_api` instead. + */ userStatus(id, options) { const url = Api.buildUrl(this.userStatusPath).replace(':id', encodeURIComponent(id)); return axios.get(url, { @@ -551,6 +579,10 @@ const Api = { }); }, + /** + * @deprecated This method will be removed soon. Use the + * `getUserProjects` method in `~/rest_api` instead. + */ userProjects(userId, query, options, callback) { const url = Api.buildUrl(Api.userProjectsPath).replace(':id', userId); const defaults = { @@ -586,6 +618,10 @@ const Api = { }); }, + /** + * @deprecated This method will be removed soon. Use the + * `updateUserStatus` method in `~/rest_api` instead. + */ postUserStatus({ emoji, message, availability }) { const url = Api.buildUrl(this.userPostStatusPath); |