mailerlite / mailerlite-go

Go SDK for MailerLite
MIT License
3 stars 3 forks source link

Differentiate between UPSERT and UPDATE #20

Closed sarajuhosova closed 10 months ago

sarajuhosova commented 10 months ago

Currently, the update operation implemented is the Upsert, using the POST method. However, this method does not allow for editing e-mail addresses, since that it what it matches on.

I have renamed the method to Upsert and made it call the Create method (since they are exactly the same, but it might be nice for developers to differentiate this in their code).

I have also added the Update operation, which uses the PUT method and matches on ID, thus allowing me to update a subscriber's email.

robgordon89 commented 10 months ago

was added here https://github.com/mailerlite/mailerlite-go/pull/21

thanks 👍