Fix bug where lack of user confirmation causes some bugs to occur
This commit is contained in:
		
							parent
							
								
									4b272a1489
								
							
						
					
					
						commit
						d4c5780444
					
				
					 1 changed files with 24 additions and 14 deletions
				
			
		|  | @ -6,21 +6,31 @@ module.exports = function(npo_id) { | ||||||
|   var eventsPath = '/nonprofits/' + npo_id + '/events/name_and_id' |   var eventsPath = '/nonprofits/' + npo_id + '/events/name_and_id' | ||||||
| 
 | 
 | ||||||
|   request.get(campaignsPath).end(function(err, resp){ |   request.get(campaignsPath).end(function(err, resp){ | ||||||
|     resp.body.unshift(false) |     var dataResponse = [] | ||||||
|     let campaign_id_names = resp.body.map((i) => { | 
 | ||||||
|       if (i.isChildCampaign) |     if (!err) { | ||||||
|       { |       resp.body.unshift(false) | ||||||
|         return {id: i.id, name: i.name + " - " + i.creator} |       dataResponse = resp.body.map((i) => { | ||||||
|       } |         if (i.isChildCampaign) | ||||||
|       else |         { | ||||||
|       { |           return {id: i.id, name: i.name + " - " + i.creator} | ||||||
|         return {id: i.id, name: i.name} |         } | ||||||
|       } |         else | ||||||
|     }) |         { | ||||||
|     appl.def('campaigns.data', campaign_id_names) |           return {id: i.id, name: i.name} | ||||||
|  |         } | ||||||
|  |       }) | ||||||
|  |     } | ||||||
|  |     appl.def('campaigns.data', dataResponse) | ||||||
|   }) |   }) | ||||||
|  | 
 | ||||||
|   request.get(eventsPath).end(function(err, resp){ |   request.get(eventsPath).end(function(err, resp){ | ||||||
|     resp.body.unshift(false) |     var dataResponse = [] | ||||||
|     appl.def('events.data', resp.body) |     if(!err) { | ||||||
|  |       resp.body.unshift(false) | ||||||
|  |       dataResponse = resp.body | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     appl.def('events.data', dataResponse) | ||||||
|   }) |   }) | ||||||
| } | } | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		
		Reference in a new issue
	
	 Eric Schultz
						Eric Schultz