diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-12-04 21:09:55 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-12-04 21:09:55 +0300 |
commit | ae42530b1be0d25186881ae45c39bdf1122a84b9 (patch) | |
tree | 0592eb5b3b23d1dcd3b00bdb3b00f3b28412a291 /app/assets/javascripts/api.js | |
parent | e0655935eb32ba057b6ced978940076681d71177 (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 | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/app/assets/javascripts/api.js b/app/assets/javascripts/api.js index f469f49ce20..f922d78a74d 100644 --- a/app/assets/javascripts/api.js +++ b/app/assets/javascripts/api.js @@ -69,6 +69,7 @@ const Api = { issuePath: '/api/:version/projects/:id/issues/:issue_iid', tagsPath: '/api/:version/projects/:id/repository/tags', freezePeriodsPath: '/api/:version/projects/:id/freeze_periods', + usageDataIncrementCounterPath: '/api/:version/usage_data/increment_counter', usageDataIncrementUniqueUsersPath: '/api/:version/usage_data/increment_unique_users', featureFlagUserLists: '/api/:version/projects/:id/feature_flags_user_lists', featureFlagUserList: '/api/:version/projects/:id/feature_flags_user_lists/:list_iid', @@ -751,6 +752,19 @@ const Api = { return axios.post(url, freezePeriod); }, + trackRedisCounterEvent(event) { + if (!gon.features?.usageDataApi) { + return null; + } + + const url = Api.buildUrl(this.usageDataIncrementCounterPath); + const headers = { + 'Content-Type': 'application/json', + }; + + return axios.post(url, { event }, { headers }); + }, + trackRedisHllUserEvent(event) { if (!gon.features?.usageDataApi) { return null; |