diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-12-05 21:07:51 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-12-05 21:07:51 +0300 |
commit | 6a7cc8c14727f6fac64a5be6838764d8d5d41468 (patch) | |
tree | 97c8a3c2f180d26f0f8f0baaa3230352b8ef1efb /app/assets/javascripts/vue_merge_request_widget/services/mr_widget_service.js | |
parent | 872319738757edc0483346c75a2407f7019b963f (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/vue_merge_request_widget/services/mr_widget_service.js')
-rw-r--r-- | app/assets/javascripts/vue_merge_request_widget/services/mr_widget_service.js | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/app/assets/javascripts/vue_merge_request_widget/services/mr_widget_service.js b/app/assets/javascripts/vue_merge_request_widget/services/mr_widget_service.js index 8a229d80954..d22cb4ced80 100644 --- a/app/assets/javascripts/vue_merge_request_widget/services/mr_widget_service.js +++ b/app/assets/javascripts/vue_merge_request_widget/services/mr_widget_service.js @@ -61,4 +61,11 @@ export default class MRWidgetService { static fetchMetrics(metricsUrl) { return axios.get(`${metricsUrl}.json`); } + + static fetchInitialData() { + return Promise.all([ + axios.get(window.gl.mrWidgetData.merge_request_cached_widget_path), + axios.get(window.gl.mrWidgetData.merge_request_widget_path), + ]).then(axios.spread((res, cachedRes) => ({ data: Object.assign(res.data, cachedRes.data) }))); + } } |