Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app/assets/javascripts/api.js')
-rw-r--r--app/assets/javascripts/api.js18
1 files changed, 3 insertions, 15 deletions
diff --git a/app/assets/javascripts/api.js b/app/assets/javascripts/api.js
index 8d46ea76be1..0c870a89760 100644
--- a/app/assets/javascripts/api.js
+++ b/app/assets/javascripts/api.js
@@ -1,4 +1,4 @@
-import createFlash from '~/flash';
+import { createAlert } from '~/flash';
import { __ } from '~/locale';
import axios from './lib/utils/axios_utils';
import { joinPaths } from './lib/utils/url_utility';
@@ -444,7 +444,7 @@ const Api = {
},
// Return group projects list. Filtered by query
- groupProjects(groupId, query, options, callback = () => {}, useCustomErrorHandler = false) {
+ groupProjects(groupId, query, options, callback = () => {}) {
const url = Api.buildUrl(Api.groupProjectsPath).replace(':id', groupId);
const defaults = {
search: query,
@@ -456,19 +456,7 @@ const Api = {
})
.then(({ data, headers }) => {
callback(data);
-
return { data, headers };
- })
- .catch((error) => {
- if (useCustomErrorHandler) {
- throw error;
- }
-
- createFlash({
- message: __('Something went wrong while fetching projects'),
- });
-
- callback();
});
},
@@ -654,7 +642,7 @@ const Api = {
})
.then(({ data }) => callback(data))
.catch(() =>
- createFlash({
+ createAlert({
message: __('Something went wrong while fetching projects'),
}),
);