Commit f0a16fbd authored by Valery Sizov's avatar Valery Sizov

[Admin Emails] The frontend should use the v3 API for now

parent aa367df9
...@@ -17,7 +17,8 @@ ...@@ -17,7 +17,8 @@
group_result = Api.groups(query.term, {}, function(groups) { group_result = Api.groups(query.term, {}, function(groups) {
return groups; return groups;
}); });
project_result = Api.projects(query.term, 'id', function(projects) { // Should be replaced with "Api.projects" when API v4 is frozen (9.1)
project_result = Api.allProjects(query.term, 'id', function(projects) {
return projects; return projects;
}); });
return $.when(project_result, group_result).done(function(projects, groups) { return $.when(project_result, group_result).done(function(projects, groups) {
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
namespacesPath: "/api/:version/namespaces.json", namespacesPath: "/api/:version/namespaces.json",
groupProjectsPath: "/api/:version/groups/:id/projects.json", groupProjectsPath: "/api/:version/groups/:id/projects.json",
projectsPath: "/api/:version/projects.json?simple=true", projectsPath: "/api/:version/projects.json?simple=true",
allProjectsPath: "/api/:version/projects/all.json?simple=true", // Deprecated. Valid for API v3 only.
labelsPath: "/:namespace_path/:project_path/labels", labelsPath: "/:namespace_path/:project_path/labels",
licensePath: "/api/:version/templates/licenses/:key", licensePath: "/api/:version/templates/licenses/:key",
gitignorePath: "/api/:version/templates/gitignores/:key", gitignorePath: "/api/:version/templates/gitignores/:key",
...@@ -67,6 +68,24 @@ ...@@ -67,6 +68,24 @@
return callback(projects); return callback(projects);
}); });
}, },
// Deprecated and should be deleted for 9.1
// Also the 'Api.allProjectsPath' should be deleted as well.
// Basically, the whole commit that adds this comment should be reverted when API v4 is frozen (9.1)
// Details here: https://gitlab.com/gitlab-org/gitlab-ce/issues/28853#note_24410695
allProjects: function(query, order, callback) {
var url = Api.buildUrl(Api.allProjectsPath);
return $.ajax({
url: url,
data: {
search: query,
order_by: order,
per_page: 20
},
dataType: "json"
}).done(function(projects) {
return callback(projects);
});
},
newLabel: function(namespace_path, project_path, data, callback) { newLabel: function(namespace_path, project_path, data, callback) {
var url = Api.buildUrl(Api.labelsPath) var url = Api.buildUrl(Api.labelsPath)
.replace(':namespace_path', namespace_path) .replace(':namespace_path', namespace_path)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment