diff --git a/src/app/components/article-service/article.service.js b/src/app/components/article-service/article.service.js index a74667d..46c08d0 100644 --- a/src/app/components/article-service/article.service.js +++ b/src/app/components/article-service/article.service.js @@ -219,6 +219,7 @@ UtilService.get(url, {params: paramsExtended}).then(function(data){ _pipeInjectSlugIntoParentProgram(data); + _pipeSortByRankinPosition(data); cbSuccess(data); }).catch(function(error){ cbError(error); @@ -237,5 +238,14 @@ } } } + + function _pipeSortByRankinPosition(data){ + if(!data.articles && data.article){ + data.articles = [data.article]; + } + data.articles = data.articles.sort(function(pA, pB){ + return pA.ranking_position - pB.ranking_position; + }); + } } })(); diff --git a/src/app/components/proposal-list/proposal-list.html b/src/app/components/proposal-list/proposal-list.html index ca523dc..2a50c27 100644 --- a/src/app/components/proposal-list/proposal-list.html +++ b/src/app/components/proposal-list/proposal-list.html @@ -32,7 +32,7 @@