Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const mailchimp = new MailchimpApi({ apiKey: settings.data.apiKey });
try {
const listsResponse = await mailchimp.get({
path: `/lists/`
});
const output = listsResponse.body.lists.map(item => ({
id: item.id,
name: item.name
}));
return new ListResponse(output);
} catch (e) {
return new ListErrorResponse(e);
}
},
getSettings: resolveGetSettings(({ models }) => models.MailchimpSettings)