From 7b9692f991859781f7fab63986a60e228a18ac71 Mon Sep 17 00:00:00 2001 From: Parman Date: Thu, 28 Aug 2025 12:18:29 +0330 Subject: [PATCH] fix(email): correct endpoint path --- src/devo_global_comms_python/models/email.py | 4 ++-- src/devo_global_comms_python/resources/email.py | 2 +- tests/test_email.py | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/devo_global_comms_python/models/email.py b/src/devo_global_comms_python/models/email.py index 49eb408..78e3089 100644 --- a/src/devo_global_comms_python/models/email.py +++ b/src/devo_global_comms_python/models/email.py @@ -9,7 +9,7 @@ class EmailSendRequest(BaseModel): """ Request model for email send API. - Used for POST /user-api/email/send + Used for POST /api/v1/user-api/email/send """ subject: str = Field(..., description="Email subject") @@ -23,7 +23,7 @@ class EmailSendResponse(BaseModel): """ Response model for email send API. - Returned from POST /user-api/email/send + Returned from POST /api/v1/user-api/email/send """ success: bool = Field(..., description="Whether the email was sent successfully") diff --git a/src/devo_global_comms_python/resources/email.py b/src/devo_global_comms_python/resources/email.py index c959aae..32ed67c 100644 --- a/src/devo_global_comms_python/resources/email.py +++ b/src/devo_global_comms_python/resources/email.py @@ -55,7 +55,7 @@ def send_email( } # Send request to the exact endpoint - response = self.client.post("email/send", json=data) + response = self.client.post("user-api/email/send", json=data) from ..models.email import EmailSendResponse diff --git a/tests/test_email.py b/tests/test_email.py index d61fc78..ec02dcd 100644 --- a/tests/test_email.py +++ b/tests/test_email.py @@ -40,7 +40,7 @@ def test_send_email_success(self, email_resource): # Verify the request was made correctly email_resource.client.post.assert_called_once_with( - "email/send", + "user-api/email/send", json={ "subject": "Hello World!", "body": "This is a test email!", @@ -128,7 +128,7 @@ def test_send_email_with_special_characters(self, email_resource): # Verify the request was made with special characters email_resource.client.post.assert_called_once_with( - "email/send", + "user-api/email/send", json={ "subject": special_subject, "body": special_body, @@ -165,7 +165,7 @@ def test_send_email_long_content(self, email_resource): ) email_resource.client.post.assert_called_once_with( - "email/send", + "user-api/email/send", json={ "subject": long_subject, "body": long_body, @@ -259,7 +259,7 @@ def test_send_email_unicode_content(self, email_resource): ) email_resource.client.post.assert_called_once_with( - "email/send", + "user-api/email/send", json={ "subject": unicode_subject, "body": unicode_body,