diff options
author | Stas Vilchik <vilchiks@gmail.com> | 2017-03-03 11:47:55 +0100 |
---|---|---|
committer | Stas Vilchik <vilchiks@gmail.com> | 2017-03-03 11:47:55 +0100 |
commit | b6baff8775a45fd057ed9f15ba9ac29633261fea (patch) | |
tree | 1f3f8e2ae50ab60ff56e8afb207c836fad62566a /server/sonar-web/src/main/js/api/issues.js | |
parent | 313ffad34e614acb9379fe1e0a0879a49b05be52 (diff) | |
download | sonarqube-b6baff8775a45fd057ed9f15ba9ac29633261fea.tar.gz sonarqube-b6baff8775a45fd057ed9f15ba9ac29633261fea.zip |
Revert "refactor source viewer (#1705)"
This reverts commit ce9f0892fc3d15638c4eaa4054ed06f3d7e5fc19.
Diffstat (limited to 'server/sonar-web/src/main/js/api/issues.js')
-rw-r--r-- | server/sonar-web/src/main/js/api/issues.js | 22 |
1 files changed, 4 insertions, 18 deletions
diff --git a/server/sonar-web/src/main/js/api/issues.js b/server/sonar-web/src/main/js/api/issues.js index 75cbdec6e2d..adcb3a1626b 100644 --- a/server/sonar-web/src/main/js/api/issues.js +++ b/server/sonar-web/src/main/js/api/issues.js @@ -20,21 +20,7 @@ // @flow import { getJSON, post } from '../helpers/request'; -type IssuesResponse = { - components?: Array<*>, - debtTotal?: number, - facets: Array<*>, - issues: Array<*>, - paging: { - pageIndex: number, - pageSize: number, - total: number - }, - rules?: Array<*>, - users?: Array<*> -}; - -export const searchIssues = (query: {}): Promise<IssuesResponse> => ( +export const searchIssues = (query: {}) => ( getJSON('/api/issues/search', query) ); @@ -66,10 +52,10 @@ export function getTags (query: {}): Promise<*> { export function extractAssignees ( facet: Array<{ val: string }>, - response: IssuesResponse + response: { users: Array<{ login: string }> } ) { return facet.map(item => { - const user = response.users ? response.users.find(user => user.login = item.val) : null; + const user = response.users.find(user => user.login = item.val); return { ...item, user }; }); } @@ -81,7 +67,7 @@ export function getAssignees (query: {}): Promise<*> { export function getIssuesCount (query: {}): Promise<*> { const data = { ...query, ps: 1, facetMode: 'effort' }; return searchIssues(data).then(r => { - return { issues: r.paging.total, debt: r.debtTotal }; + return { issues: r.total, debt: r.debtTotal }; }); } |