Skip to content
This repository was archived by the owner on Mar 4, 2025. It is now read-only.

Commit 3771459

Browse files
author
vikasrohit
committed
AS#118090147171048, Mail chimp Integration
-- Misc fixes to get it working
1 parent 506b888 commit 3771459

File tree

3 files changed

+17
-3
lines changed

3 files changed

+17
-3
lines changed

app/services/api.service.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,10 @@ import _ from 'lodash'
9595
})
9696
.setDefaultHeaders({ 'Content-Type': 'application/json' })
9797
.addRequestInterceptor(function(element, operation, what, url) {
98+
// for mailchimp api, don't add param field in the body
99+
if (url.indexOf('mailchimp') > -1) {
100+
return element
101+
}
98102
if (url.indexOf('members') > -1 || (operation.toLowerCase() === 'post' && url.indexOf('profiles') > -1)) {
99103
return {
100104
param: element

app/services/mailchimp.service.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,17 @@ import angular from 'angular'
2323
resolve(resp)
2424
})
2525
.catch(function(err) {
26-
logger.error('Error adding member to subscription list', err)
26+
if (err.status === 404) {
27+
logger.debug('Member subscription not found')
28+
resolve()
29+
return
30+
}
31+
logger.error('Error getting member to subscription list', err)
2732

2833
var errorStatus = 'FATAL_ERROR'
2934
reject({
3035
status: errorStatus,
31-
msg: err.data.result.content
36+
msg: err.errorMessage
3237
})
3338
})
3439
})
@@ -60,7 +65,7 @@ import angular from 'angular'
6065

6166
reject({
6267
status: errorStatus,
63-
msg: err.data.result.content
68+
msg: err.errorMessage
6469
})
6570
})
6671
})

app/skill-picker/skill-picker.controller.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,9 +144,14 @@ import _ from 'lodash'
144144
if (!subscription) {
145145
return MailchimpService.addSubscription(userProfile).then(function(resp) {
146146
logger.debug(resp)
147+
}).catch(function(err) {
148+
// no error to user
149+
//TODO some error alert to community admin
150+
logger.debug('error in adding user to member list')
147151
})
148152
}
149153
}).catch(function(err) {
154+
// no error to user
150155
//TODO some error alert to community admin
151156
logger.debug('error in adding user to member list')
152157
})

0 commit comments

Comments
 (0)