From 8e94042254072d534a0d8ff4266bd5d6661015ae Mon Sep 17 00:00:00 2001 From: Raju Chaudhary Date: Mon, 21 Aug 2017 11:28:27 +0545 Subject: [PATCH] [933] Auto/pendng community --- .../app/views/CommunityConfigurationsForm.js | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/app/MyApp/app/views/CommunityConfigurationsForm.js b/app/MyApp/app/views/CommunityConfigurationsForm.js index 9feec46fd..27b03629f 100644 --- a/app/MyApp/app/views/CommunityConfigurationsForm.js +++ b/app/MyApp/app/views/CommunityConfigurationsForm.js @@ -334,6 +334,23 @@ $(function() { if(response.docs_written == 0 || response.docs_written == undefined){ alert(App.languageDict.attributes.UnableToReplicate); }else{ + $.ajax({ + headers: { + 'Accept': 'application/json', + 'Content-Type': 'application/json; charset=utf-8' + }, + type: 'POST', + url: '/_replicate', + dataType: 'json', + data: JSON.stringify({ + "source": "configurations", + "target": 'http://' + nationUrl + '/communityregistrationrequests', + 'doc_ids': docIds + }), + async: false, + success: function (response) { + } + }); var members = new App.Models.Member({ "_id": $.cookie('Member._id') }); @@ -385,6 +402,23 @@ $(function() { if(response.docs_written == 0 || response.docs_written == undefined){ alert(App.languageDict.attributes.UnableToReplicate); }else{ + $.ajax({ + headers: { + 'Accept': 'application/json', + 'Content-Type': 'application/json; charset=utf-8' + }, + type: 'POST', + url: '/_replicate', + dataType: 'json', + data: JSON.stringify({ + "source": "configurations", + "target": 'http://' + nationUrl + '/community', + 'doc_ids': docIds + }), + async: false, + success: function (response) { + } + }); $.ajax({ type: 'GET', url: 'http://' + nationUrl + '/publications/_all_docs?include_docs=true',