Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated bulk suppression list upsert payload. #144

Merged
merged 1 commit into from
May 10, 2016
Merged

Updated bulk suppression list upsert payload. #144

merged 1 commit into from
May 10, 2016

Conversation

aydrian
Copy link
Contributor

@aydrian aydrian commented May 10, 2016

Fixes #140

For bulk upserts we needed to send a payload of an object with a recipients key. We were sending an array of recipients.

@@ -64,7 +64,7 @@ module.exports = function(client) {
// Check for bulk upsert
if(recipient.constructor === Array) {
options.uri = api;
options.json = toApiFormat(recipient);
options.json = { recipients: toApiFormat(recipient) };
} else if(!recipient.email) {
Copy link
Contributor

@jgzamora jgzamora May 10, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Single recipient upload isn't supported anymore, so this else block should just error out with the same error we were getting from the API. Alternatively it could insert the single value into an array.

@jgzamora
Copy link
Contributor

The whole function should be updated to remove the old convention of single upsert (/suppressions/:email), which is no longer supported. Relevant examples and tests should be deleted.

@aydrian
Copy link
Contributor Author

aydrian commented May 10, 2016

Okay. Let's add that as another issue.

@jgzamora jgzamora merged commit 04f5f0b into SparkPost:master May 10, 2016
@aydrian aydrian deleted the issue-140 branch May 10, 2016 15:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants