File tree Expand file tree Collapse file tree 2 files changed +7
-5
lines changed
integrations/mailchimp/src Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ ' @gitbook/integration-mailchimp ' : minor
3
+ ---
4
+
5
+ Updates check to look for listID as function returns out before it can find a list to subscribe to
Original file line number Diff line number Diff line change @@ -65,15 +65,12 @@ const mailchimpSubscribe = createComponent<
65
65
if ( ! accessToken ) {
66
66
throw new ExposableError ( 'Mailchimp integration not configured' ) ;
67
67
}
68
- if ( ! element . props . listId ) {
69
- throw new ExposableError ( 'No list ID provided' ) ;
70
- }
71
68
72
69
try {
73
70
const listId = await resolveMailingListId (
74
- element . props . listId ,
75
71
configuration . api_endpoint ,
76
72
accessToken ,
73
+ element . props . listId ,
77
74
) ;
78
75
79
76
if ( ! listId ) {
@@ -166,9 +163,9 @@ const mailchimpSubscribe = createComponent<
166
163
} ) ;
167
164
168
165
async function resolveMailingListId (
169
- propListId : string ,
170
166
apiEndpoint : string ,
171
167
accessToken : string ,
168
+ propListId ?: string ,
172
169
) : Promise < string | undefined > {
173
170
if ( propListId ) {
174
171
return propListId ;
You can’t perform that action at this time.
0 commit comments