Closed thenoblet closed 2 weeks ago
I suggest that you use a more generic key-value system and do not pre-define the individual pieces. This way people can add new sections to the about page
I suggest that you use a more generic key-value system and do not pre-define the individual pieces. This way people can add new sections to the about page
Yessir! On it. 🫡
@markessien, I refined the issue, Sir.
The updated issue uses a generic key-value system, which allows for a more dynamic and flexible approach to managing the About page content.
I added a customSections key that can hold any number of key-value pairs. This makes it easy to add, modify, or remove sections without changing the backend code.
Administrators can simply add a new key-value pair to the customSections object, such as "history": "Our company was founded in...", without requiring any changes to the backend.
Example: Adding a new "history" section
Endpoint: PUT /api/v1/about
Request Body:
{
"title": "More Than Just A BoilerPlate",
"introduction": "Welcome to Hng Boilerplate, where passion meets innovation.",
"custom_sections": {
"stats": {
"years_in_business": 10,
"customers": 75000,
"monthly_blog_readers": 100000,
"social_followers": 1200000
},
"services": {
"title": "Trained to Give You The Best",
"description": "Since our founding, Hng Boilerplate has been dedicated to constantly evolving to stay ahead of the curve."
},
**"history": "Our company was founded in 2010..."**
}
}
More than one endpoints. Please break it up and focus on one specific endpoint for easy tracking
@thenoblet
Response doesnt follow org structure.
{
"content": {
"title": "More Than Just A BoilerPlate",
"introduction": "Welcome to Hng Boilerplate, where passion meets innovation.",
"customSections": {
"stats": {
"yearsInBusiness": 10,
"customers": 75000,
"monthlyBlogReaders": 100000,
"socialFollowers": 1200000
},
"services": {
"title": "Trained to Give You The Best",
"description": "Since our founding, Hng Boilerplate has been dedicated to constantly evolving to stay ahead of the curve."
}
}
},
"updatedAt": "2024-07-18T12:00:00Z",
"statusCode": 200
}
Authentication and Authorization?
@highb33kay, I have refined it to include authorisation & authentication, broken them into specific endpoints, and changed the Response to follow org structure.
RETRIEVE operation issue #265
Hello
Hello
@markessien, @highb33kay
An Afterthought (DB schema): Whilst implementing this, I realised it'd be cool to track which admin made changes to the content of the About Page. So, I'll need to extend the database schema and application logic to include user information for auditing purposes.
Is that something I can do, please? The DB and Auth guys are not really coming to through for us. Painful.
@nadduli and @githukueliud, guys look out for the response here.
Description
Implement an endpoint to UPDATE the content of the About page, allowing administrators to modify the information efficiently.
Purpose
Acceptance Criteria
Update About Page Content
Requirements
Update About Page Content
PUT /api/v1/content/about
endpoint to update About page content.Expected Outcome
Checklist
Update About Page Content
PUT /api/v1/content/about
endpoint.Testing
Documentation:
Endpoint
Description: Update the content of the About page.
Endpoint:
PUT /api/v1/content/about
Authentication: Required
Authorization: Administrators only
Request Body:
Response (Success):
Response (Error: Server Error):
Response (Error: Unauthenticated):
Response (Error: Authenticated but Unauthorised):
Additional Notes: