diff options
author | Simon Knox <psimyn@gmail.com> | 2017-09-06 18:02:30 +1000 |
---|---|---|
committer | Simon Knox <psimyn@gmail.com> | 2017-09-06 18:02:30 +1000 |
commit | 563c7de58e010ddbede4fdf5de8229617ef9f96f (patch) | |
tree | 14132eb94aed4e894ae3fb93030cad3a23b2194e | |
parent | feffc3ec4546bf07d47e6be8b3b63421362103d2 (diff) | |
download | gitlab-ce-563c7de58e010ddbede4fdf5de8229617ef9f96f.tar.gz |
api js changes not needed for CE
-rw-r--r-- | app/assets/javascripts/api.js | 12 | ||||
-rw-r--r-- | spec/javascripts/api_spec.js | 21 |
2 files changed, 2 insertions, 31 deletions
diff --git a/app/assets/javascripts/api.js b/app/assets/javascripts/api.js index 501cc43d552..7b00e1fa780 100644 --- a/app/assets/javascripts/api.js +++ b/app/assets/javascripts/api.js @@ -6,8 +6,7 @@ const Api = { namespacesPath: '/api/:version/namespaces.json', groupProjectsPath: '/api/:version/groups/:id/projects.json', projectsPath: '/api/:version/projects.json', - projectLabelsPath: '/:namespace_path/:project_path/labels', - groupLabelsPath: '/groups/:namespace_path/labels', + labelsPath: '/:namespace_path/:project_path/labels', licensePath: '/api/:version/templates/licenses/:key', gitignorePath: '/api/:version/templates/gitignores/:key', gitlabCiYmlPath: '/api/:version/templates/gitlab_ci_ymls/:key', @@ -75,14 +74,7 @@ const Api = { }, newLabel(namespacePath, projectPath, data, callback) { - let url; - if (projectPath) { - url = Api.buildUrl(Api.projectLabelsPath) - .replace(':namespace_path', namespacePath) - .replace(':project_path', projectPath); - } else { - url = Api.buildUrl(Api.groupLabelsPath).replace(':namespace_path', namespacePath); - } + const url = Api.buildUrl(Api.labelsPath); return $.ajax({ url, type: 'POST', diff --git a/spec/javascripts/api_spec.js b/spec/javascripts/api_spec.js index 643b22a00f8..2aa4fb1f6c6 100644 --- a/spec/javascripts/api_spec.js +++ b/spec/javascripts/api_spec.js @@ -167,27 +167,6 @@ describe('Api', () => { done(); }); }); - - it('creates a new group label', (done) => { - const namespace = 'some namespace'; - const labelData = { some: 'data' }; - const expectedUrl = `${dummyUrlRoot}/${namespace}/labels`; - const expectedData = { - label: labelData, - }; - spyOn(jQuery, 'ajax').and.callFake((request) => { - expect(request.url).toEqual(expectedUrl); - expect(request.dataType).toEqual('json'); - expect(request.type).toEqual('POST'); - expect(request.data).toEqual(expectedData); - return sendDummyResponse(); - }); - - Api.newLabel(namespace, null, labelData, (response) => { - expect(response).toBe(dummyResponse); - done(); - }); - }); }); describe('groupProjects', () => { |