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<
6565 if ( ! accessToken ) {
6666 throw new ExposableError ( 'Mailchimp integration not configured' ) ;
6767 }
68- if ( ! element . props . listId ) {
69- throw new ExposableError ( 'No list ID provided' ) ;
70- }
7168
7269 try {
7370 const listId = await resolveMailingListId (
74- element . props . listId ,
7571 configuration . api_endpoint ,
7672 accessToken ,
73+ element . props . listId ,
7774 ) ;
7875
7976 if ( ! listId ) {
@@ -166,9 +163,9 @@ const mailchimpSubscribe = createComponent<
166163} ) ;
167164
168165async function resolveMailingListId (
169- propListId : string ,
170166 apiEndpoint : string ,
171167 accessToken : string ,
168+ propListId ?: string ,
172169) : Promise < string | undefined > {
173170 if ( propListId ) {
174171 return propListId ;
You can’t perform that action at this time.
0 commit comments