diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-06-16 18:25:58 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-06-16 18:25:58 +0000 |
commit | a5f4bba440d7f9ea47046a0a561d49adf0a1e6d4 (patch) | |
tree | fb69158581673816a8cd895f9d352dcb3c678b1e /app/assets/javascripts/packages/list/stores/actions.js | |
parent | d16b2e8639e99961de6ddc93909f3bb5c1445ba1 (diff) | |
download | gitlab-ce-a5f4bba440d7f9ea47046a0a561d49adf0a1e6d4.tar.gz |
Add latest changes from gitlab-org/gitlab@14-0-stable-eev14.0.0-rc42
Diffstat (limited to 'app/assets/javascripts/packages/list/stores/actions.js')
-rw-r--r-- | app/assets/javascripts/packages/list/stores/actions.js | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/app/assets/javascripts/packages/list/stores/actions.js b/app/assets/javascripts/packages/list/stores/actions.js index 8dfe3c82ab3..81f587971c2 100644 --- a/app/assets/javascripts/packages/list/stores/actions.js +++ b/app/assets/javascripts/packages/list/stores/actions.js @@ -1,5 +1,5 @@ import Api from '~/api'; -import { deprecatedCreateFlash as createFlash } from '~/flash'; +import createFlash from '~/flash'; import axios from '~/lib/utils/axios_utils'; import { DELETE_PACKAGE_ERROR_MESSAGE } from '~/packages/shared/constants'; import { @@ -43,7 +43,9 @@ export const requestPackagesList = ({ dispatch, state }, params = {}) => { dispatch('receivePackagesListSuccess', { data, headers }); }) .catch(() => { - createFlash(FETCH_PACKAGES_LIST_ERROR_MESSAGE); + createFlash({ + message: FETCH_PACKAGES_LIST_ERROR_MESSAGE, + }); }) .finally(() => { dispatch('setLoading', false); @@ -52,7 +54,9 @@ export const requestPackagesList = ({ dispatch, state }, params = {}) => { export const requestDeletePackage = ({ dispatch, state }, { _links }) => { if (!_links || !_links.delete_api_path) { - createFlash(DELETE_PACKAGE_ERROR_MESSAGE); + createFlash({ + message: DELETE_PACKAGE_ERROR_MESSAGE, + }); const error = new Error(MISSING_DELETE_PATH_ERROR); return Promise.reject(error); } @@ -65,10 +69,15 @@ export const requestDeletePackage = ({ dispatch, state }, { _links }) => { const page = getNewPaginationPage(currentPage, perPage, total - 1); dispatch('requestPackagesList', { page }); - createFlash(DELETE_PACKAGE_SUCCESS_MESSAGE, 'success'); + createFlash({ + message: DELETE_PACKAGE_SUCCESS_MESSAGE, + type: 'success', + }); }) .catch(() => { dispatch('setLoading', false); - createFlash(DELETE_PACKAGE_ERROR_MESSAGE); + createFlash({ + message: DELETE_PACKAGE_ERROR_MESSAGE, + }); }); }; |