The endpoint should allow Admin to update the platform details.
Approach
Utilized the existing /api/admin/platform endpoint to handle a PUT request with a body of the updated platform. Implemented the rrror handing with status codes and also the unit tests are written.
Response for update request:
{
"platform": {
"description": "This is a updated description.",
"mentor_questions": [
{
"question": "What are your career goals?",
"question_type": "text",
"options": []
},
{
"question": "How do you handle challenges?",
"question_type": "text",
"options": []
},
{
"question": "Tell me about a time when you demonstrated leadership skills.",
"question_type": "text",
"options": []
}
],
"image_url": "https://example.com/images/sample.jpg",
"landing_page_url": "https://example.com/landing-page",
"email_templates": {
"template1": {
"subject": "Welcome to our mentoring program!",
"body": "Dear {{mentor_name}},\n\nWe are excited to have you join our mentoring program..."
},
"template2": {
"subject": "Follow-up on your mentoring session",
"body": "Dear {{mentee_name}},\n\nI wanted to follow up on our recent mentoring session..."
}
},
"title": "Sample Mentoring Program",
"uuid": "89a1c2a6-8c39-420e-8274-a1719b1667c1",
"created_at": "2023-10-27T10:26:10.652Z",
"updated_at": "2023-10-27T10:26:10.652Z"
},
"message": "Platform updated successfully"
}
Screenshots
Checklist
[x] This PR doesn't commit any keys, passwords, tokens, usernames, or other secrets.
Purpose
The purpose of this PR is to fix #36
Goals
The endpoint should allow Admin to update the platform details.
Approach
Utilized the existing
/api/admin/platform
endpoint to handle aPUT
request with a body of the updated platform. Implemented the rrror handing with status codes and also the unit tests are written.Response for update request:
Screenshots
Checklist
Related PRs
## Test environment ## Learning