Commit 7496ba0089cdeecb396c0a14503f1cd8810bc176

Authored by Leonardo Merlin
1 parent fa157c49

Create proposal with category

src/app/components/article-service/article.service.js
... ... @@ -137,7 +137,7 @@
137 137 getProposalById(topicId + '/children', params, cbSuccess, cbError);
138 138 }
139 139  
140   - function createProposal (proposal, targetId, cbSuccess, cbError){
  140 + function createProposal (proposal, targetId, categoryId, cbSuccess, cbError){
141 141  
142 142 if(!$rootScope.currentUser){
143 143 cbError({message: 'Usuário não logado.'});
... ... @@ -147,6 +147,7 @@
147 147  
148 148 var encodedParams = [];
149 149 encodedParams.push('article%5Babstract%5D=' + proposal);
  150 + encodedParams.push('article%5Bcategory_ids%5D%5B%5D=' + categoryId);
150 151 encodedParams.push('article%5Btype%5D=ProposalsDiscussionPlugin%3A%3AProposal');
151 152 encodedParams.push('content_type=ProposalsDiscussionPlugin%3A%3AProposal');
152 153 encodedParams.push('private_token=' + $rootScope.currentUser.private_token);
... ...
src/app/pages/programas/programa.controller.js
... ... @@ -123,7 +123,8 @@
123 123  
124 124 vm.proposalStatus = vm.PROPOSAL_STATUS.SENDING;
125 125  
126   - vm.DialogaService.createProposal(proposal, vm.article.id, function(response) {
  126 + var category_id = vm.article.categories[0].id;
  127 + vm.DialogaService.createProposal(proposal, vm.article.id, category_id, function(response) {
127 128 vm.$log.debug('response', response);
128 129 // vm.message =
129 130 // vm.proposalStatus = vm.PROPOSAL_STATUS.SENT | vm.PROPOSAL_STATUS.SUCCESS;
... ...