Commit 720037781a1ba788464681bfde853c9f381b7157

Authored by Leonardo Merlin
1 parent dbaeccc0

Service: add getTerms

src/app/components/article-service/article.service.js
... ... @@ -124,7 +124,7 @@
124 124 'fields[]': ['id', 'title', 'abstract', 'children', 'children_count'],
125 125 'limit':'20',
126 126 'page':'1',
127   - 'content_type':'ProposalsDiscussionPlugin::Proposals'
  127 + 'content_type':'ProposalsDiscussionPlugin::Proposal'
128 128 }, params);
129 129  
130 130 UtilService.get(url, {params: paramsExtended}).then(function(data){
... ...
src/app/components/dialoga-service/dialoga.service.js
... ... @@ -14,6 +14,7 @@
14 14 extendedService.serviceDialoga = $rootScope.basePath + '/api/v1/dialoga_plugin/';
15 15 extendedService.getHome = getHome;
16 16 extendedService.getAbout = getAbout;
  17 + extendedService.getTerms = getTerms;
17 18 extendedService.getThemes = getThemes;
18 19 extendedService.getPrograms = getPrograms;
19 20 extendedService.getProgramBySlug = getProgramBySlug;
... ... @@ -61,6 +62,19 @@
61 62 }
62 63 }
63 64  
  65 + function getTerms (cbSuccess, cbError) {
  66 + if( !!CACHE.terms ){
  67 + cbSuccess(CACHE.terms);
  68 + }else{
  69 + // load article content
  70 + ArticleService.getArticleById(API.articleId.terms, {}, function (article){
  71 + CACHE.terms = article;
  72 +
  73 + cbSuccess(CACHE.terms);
  74 + }, cbError);
  75 + }
  76 + }
  77 +
64 78 function getThemes (cbSuccess, cbError) {
65 79 if( !!CACHE.themes ){
66 80 cbSuccess(CACHE.themes);
... ...