About Us & Team Management
This section provides instructions for managing the core identity and personnel of your campus. Using the Administrative CMS, you can update institutional history, mission statements, and faculty/staff profiles.
About Us Management
The "About Us" module is designed to handle static yet vital content such as campus history, the Chairman's message, and organizational goals.
Content Operations
All "About Us" content is managed through the aboutsAPI.js module. These operations require an active administrator session and a valid authToken stored in localStorage.
| Function | Purpose | Input |
| :--- | :--- | :--- |
| getAllaboutUs | Fetches all "About" sections. | N/A |
| addAboutUs | Creates a new content section. | Object (Content details) |
| updateAboutUsById | Edits existing content by ID. | ID, Object (Updated data) |
| deleteAboutUs | Removes a specific section. | ID |
Implementation Example
To update a specific section (e.g., the Chairman's Message), you can use the following pattern:
import { updateAboutUsById } from './path-to-api/aboutsAPI';
const handleUpdate = async (contentId, updatedData) => {
try {
const response = await updateAboutUsById(contentId, updatedData);
console.log("Content updated successfully:", response);
} catch (error) {
// Error handling for missing tokens or server issues
}
};
Team & Faculty Management
The Team module allows for the dynamic management of faculty members, administrative staff, and board members. This ensures that the public-facing "Our Team" page remains current with new hires or role changes.
Member Profile Operations
The teamApi.js provides the interface for managing personnel. Each profile typically includes a name, designation, image, and description.
| Function | Purpose | Input |
| :--- | :--- | :--- |
| getAllTeams | Retrieves the full list of staff/faculty. | N/A |
| addTeam | Adds a new member profile. | Object (Member data) |
| updateTeamById | Updates details for a specific member. | ID, Object (New data) |
| deleteTeam | Removes a member profile from the system. | ID |
Adding a New Team Member
When adding a member, ensure the data object contains the necessary fields expected by your backend schema (typically multipart/form-data if uploading images).
import { addTeam } from './path-to-api/teamApi';
const addNewMember = async (memberData) => {
try {
const result = await addTeam(memberData);
alert("Member added to the faculty list.");
} catch (error) {
console.error("Failed to add member", error);
}
};
Authentication & Security
All management functions within these modules are protected. The API calls automatically attempt to retrieve a Bearer token from the local storage.
- Authorization: The system uses
getAuthToken()to inject anAuthorization: Bearer <token>header into requests. - Private Routes: Access to the management UI for these components is wrapped in the
PrivateRoutescomponent, which redirects unauthorized users to the/signInpage. - Role Verification: The
useAuthhook ensures that only users with the appropriate admin permissions can trigger theadd,update, ordeletefunctions.
Data Structures
For both About Us and Team management, the API expects standard JSON objects.
Example Team Member Object:
{
"name": "Dr. Jane Doe",
"designation": "Head of Department - CS",
"email": "jane.doe@campus.edu",
"image": "profile_url.jpg",
"status": true
}
Example About Us Object:
{
"title": "Our History",
"content": "<p>Established in 1998, our campus has...</p>",
"category": "History"
}