You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The current API endpoints for email templates are not following standard RESTful conventions. Specifically, the HTTP methods used for several endpoints are non-standard for their intended operations. This PR updates the endpoints to follow RESTful conventions and fixes the HTTP methods for proper resource management.
Steps to Reproduce
Review the existing email template API endpoints.
Observe that non-standard HTTP methods are being used for certain operations:
POST for storing and deleting templates
POST for retrieving a template
PATCH for updating a template
After applying the fix, the endpoints should use the appropriate HTTP methods (POST → GET → PATCH → DELETE).
Expected Behavior
The API should use the standard HTTP methods for each operation:
POST for creating a new resource (store template).
GET for retrieving resources (get a template or list of templates).
PATCH for updating a resource (update template).
DELETE for deleting a resource (delete template).
Endpoints should be properly structured according to RESTful conventions.
Current Behavior
The current endpoints are using non-standard methods:
POST for retrieving a template and deleting a template, which is not the correct HTTP method for these actions.
POST for storing a new template.
PATCH for updating a template, which is correct but needs to be better structured in the new route.
Inconsistencies exist in how resources are managed and requested.
Fixes Applied
Updated HTTP methods for various endpoints to follow RESTful conventions:
POST → POST for storing a new template (unchanged).
GET for retrieving all templates (/api/v1/email/templates).
GET for retrieving a single template (/api/v1/email/templates/{templateName}).
PATCH for updating a template (/api/v1/email/templates/{templateName}).
DELETE for deleting a template (/api/v1/email/templates/{templateName}).
Changed the URL paths to better reflect RESTful resource naming conventions:
Jayflashy
changed the title
[FIX] Change Delete Template Endpoint from POST to Use DELETE Method
REFACTOR: Email Template Endpoints to Follow RESTful Conventions and Correct HTTP Methods
Mar 1, 2025
Jayflashy
changed the title
REFACTOR: Email Template Endpoints to Follow RESTful Conventions and Correct HTTP Methods
FIX: Email Template Endpoints to Follow RESTful Conventions and Correct HTTP Methods
Mar 1, 2025
Jayflashy
changed the title
FIX: Email Template Endpoints to Follow RESTful Conventions and Correct HTTP Methods
FIX: Email Template Endpoints to Follow RESTful and Correct HTTP Methods
Mar 1, 2025
Bug Description
The current API endpoints for email templates are not following standard RESTful conventions. Specifically, the HTTP methods used for several endpoints are non-standard for their intended operations. This PR updates the endpoints to follow RESTful conventions and fixes the HTTP methods for proper resource management.
Steps to Reproduce
Expected Behavior
Current Behavior
Fixes Applied
Updated HTTP methods for various endpoints to follow RESTful conventions:
/api/v1/email/templates
)./api/v1/email/templates/{templateName}
)./api/v1/email/templates/{templateName}
)./api/v1/email/templates/{templateName}
).Changed the URL paths to better reflect RESTful resource naming conventions:
/api/v1/email/store-template
→/api/v1/email/templates
/api/v1/email/get-template
→/api/v1/email/templates/{templateName}
/api/v1/email/delete-template
→/api/v1/email/templates/{templateName}
/api/v1/email/get-all-templates
→/api/v1/email/templates
Screenshots/Logs
Environment
Additional Context
The text was updated successfully, but these errors were encountered: