Skip to content

Commit

Permalink
Fix Contacts list method (#63)
Browse files Browse the repository at this point in the history
  • Loading branch information
thedatadavis authored Jan 17, 2024
1 parent 66fa2d2 commit 60b715b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions resend/contacts.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,19 @@ def update(cls, params={}) -> Dict:
return request.Request(path=path, params=params, verb="patch").perform()

@classmethod
# https://resend.com/docs/api-reference/audiences/list-audiences
# https://resend.com/docs/api-reference/contacts/list-contacts
def list(cls, audience_id) -> Dict:
path = f"/audiences/#{audience_id}/contacts"
path = f"/audiences/{audience_id}/contacts"
return request.Request(path=path, params={}, verb="get").perform()

@classmethod
# https://resend.com/docs/api-reference/audiences/get-audience
# https://resend.com/docs/api-reference/contacts/get-contact
def get(cls, audience_id, id) -> Dict:
path = f"/audiences/{audience_id}/contacts/{id}"
return request.Request(path=path, params={}, verb="get").perform()

@classmethod
# https://resend.com/docs/api-reference/audiences/delete-audience
# https://resend.com/docs/api-reference/contacts/delete-contact
def remove(cls, audience_id, id="", email="") -> Dict:
contact = email if id == "" else id
if contact == "":
Expand Down

0 comments on commit 60b715b

Please sign in to comment.