API Documentation
The backend provides the following API endpoints to manage global settings.
1. Fetch Global Settings
- Endpoint:
GET /admin/settings
- Description: Retrieves the current global settings.
- Response:
2. Update Global Settings
- Endpoint:
PATCH /admin/settings
- Description: Updates the global settings.
- Request Body:
3. Upload Site Logo
- Endpoint:
POST /admin/settings/upload-logo
- Description: Uploads and updates a site logo or favicon.
- Request Parameters:
file: The image file to be uploaded (logo or favicon).
fieldName: The setting field to update (siteLogoLight, siteLogoDark, favicon).
- Response:
4. Delete Site Logo
- Endpoint:
DELETE /admin/settings/logo
- Description: Deletes a specific logo or favicon.
- Request Body:
- Response:
Frontend Implementation
Retrieving Global Settings
To fetch and display global settings in the admin panel:
Updating Global Settings
To allow administrators to update global settings:
Uploading a Logo
To upload a logo and update the corresponding setting:
Conclusion
The Global Settings module enables administrators to customize key aspects of the site, including branding, SEO metadata, and email configurations. The API endpoints provide seamless integration for frontend management, ensuring an optimized and dynamic user experience.
To maintain consistency and avoid manual updates, ensure that the robots.txt file references the correct sitemap URL and that the SEO metadata is configured properly for optimal indexing.