consolidated

This commit is contained in:
Harikrishnan Gopal
2025-01-22 11:58:26 +05:30
parent 9e1734e395
commit e7fb1583d7
3 changed files with 78 additions and 39 deletions

View File

@@ -8,11 +8,11 @@ const ConsolidatedTable = () => {
useEffect(() => {
const fetchData = async () => {
try {
const response = await axios.get("http://localhost:8080/api/data/consolidated");
const response = await axios.get("http://localhost:8080/api/table/consolidated-table");
setData(response.data);
setLoading(false);
} catch (error) {
console.error("Error fetching consolidated data:", error);
console.error("Error fetching table data:", error);
setLoading(false);
}
};
@@ -26,29 +26,51 @@ const ConsolidatedTable = () => {
return (
<div>
<h1>Consolidated Data</h1>
<h1>Consolidated Table</h1>
<table border="1" style={{ width: "100%", textAlign: "left" }}>
<thead>
<tr>
<th>Faculty ID</th>
<th>Faculty Name</th>
<th>Course ID</th>
<th>Sr No</th>
<th>Semester</th>
<th>Course Code</th>
<th>Course Name</th>
<th>Task</th>
<th>Exam Type</th>
<th>Year</th>
<th>Marks</th>
<th>Name</th>
<th>Affiliation/College</th>
<th>Highest Qualification</th>
<th>Career Experience</th>
<th>Oral/Practical</th>
<th>Assessment</th>
<th>Reassessment</th>
<th>Paper Setting</th>
<th>Moderation</th>
<th>PwD Paper Setting</th>
</tr>
</thead>
<tbody>
{data.map((faculty) =>
faculty.tasks.map((task, index) => (
<tr key={`${faculty.facultyId}-${index}`}>
<td>{faculty.facultyId}</td>
<td>{faculty.facultyName}</td>
<td>{task.courseId}</td>
<td>{task.courseName}</td>
<td>{task.task}</td>
</tr>
))
)}
{data.map((row, index) => (
<tr key={index}>
<td>{row.srNo}</td>
<td>{row.semester}</td>
<td>{row.courseCode}</td>
<td>{row.courseName}</td>
<td>{row.examType}</td>
<td>{row.year}</td>
<td>{row.marks}</td>
<td>{row.Name}</td>
<td>{row.affiliation}</td>
<td>{row.qualification}</td>
<td>{row.experience}</td>
<td>{row.oralPractical}</td>
<td>{row.assessment}</td>
<td>{row.reassessment}</td>
<td>{row.paperSetting}</td>
<td>{row.moderation}</td>
<td>{row.pwdPaperSetting}</td>
</tr>
))}
</tbody>
</table>
</div>