Skip to content

Commit

Permalink
Merge pull request #90 from deepali-chavhan/issue-fix
Browse files Browse the repository at this point in the history
fix: issues fixes in student and teacher component
  • Loading branch information
ankush-maherwal authored Nov 23, 2024
2 parents 9d37425 + fd16065 commit 380ccfc
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 16 deletions.
18 changes: 9 additions & 9 deletions packages/admin/src/api/studentBulkAPI.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ const studentBulkAPI = async (student) => {
.then((res) => {

// Extract student information and store it in localStorage
const responses = res.data.responses;
const responses = res?.data?.data?.responses;

responses.forEach(response => {
const studentId = response.studentId;
const message = response.message;
const username = response.username;
const schoolUdise = response.schoolUdise;
const studentId = response?.studentId;
const message = response?.message;
const username = response?.username;
const schoolUdise = response?.schoolUdise;

const studentData = {
studentId,
Expand All @@ -41,17 +41,17 @@ const studentBulkAPI = async (student) => {

});

localStorage.setItem("successCount", res.data.successCount);
localStorage.setItem("errorCount", res.data.errors.length);
localStorage.setItem("successCount", res?.data?.data?.successCount);
localStorage.setItem("errorCount", res?.data?.data?.errors?.length);

if (res.status === 201) {
if (res?.status === 201) {
result = true;
} else {
result = false;
}
})
.catch(function (error) {
console.log(error.response.data.error);
console.log(error?.response?.data?.error);
let err = 0;
return err;
});
Expand Down
2 changes: 1 addition & 1 deletion packages/admin/src/assets/images/FinalSchool.csv
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
School UDISE code,School Name,Location,School Management,School Composition,Board,Medium of Instruction,Head Master,Headmaster Type,Headmaster Mobile,Number of teachers sanctioned -Upper Primary,Number of teachers sanctioned -Secondary,Library Functional,Computer Lab functional,Number of functional computers,Number of Boys toilet,Number of Girls toilet,Smart Board functional in Class 6,Smart Board functional in Class 7,Smart Board functional in Class 8,Smart Board functional in Class 9,Smart Board functional in Class 10,State,District,Block,Adequate Rooms For EveryClass,Drinking Water Supply,Separate Toilet For Girls And Boys,Whether Toilet Being Used,Playground Available,Boundary Wall Fence,Electric Fittings Are Insulated,Building Is Resistant To Earthquake Fire Flood Other Calamity,Building Is Free From Inflammable And Toxic Materials,Roof And Walls Are In Good Condition
234234234,New Park School,Urban,Others,Boys,Odisha,English,dummy,FullTime,8805852647,1,5,Yes,Yes,1,1,1,Yes,Yes,Yes,Yes,Yes,Maharashtra,Pune,Pune,TRUE,TRUE,TRUE,TRUE,TRUE,TRUE,TRUE,TRUE,TRUE,TRUE
6969696969,New Park School,Urban,Others,Boys,Odisha,English,dummy,FullTime,8805852647,1,5,Yes,Yes,1,1,1,Yes,Yes,Yes,Yes,Yes,Maharashtra,Pune,Pune,True,True,True,True,True,True,True,True,True,True
4 changes: 2 additions & 2 deletions packages/admin/src/assets/images/FinalStudent.csv
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
name,username,email,mobile,gender,dateOfBirth,board,password,status,className,religion,school_udise,caste,annual_income,mother_education,father_education,mother_occupation,father_occupation,No_of_siblings,promotion,state,district,block
Test,retesttekdiwb600112121884,,9999999999,Female ,1990-01-03,West Bengal,NA ,TRUE,Class 7,Hindu,12345678,General,668,,,,,,,maharastra,pune,kothrud
name,username,email,mobile,gender,dateOfBirth,board,password,status,className,religion,school_udise,caste,annual_income,mother_education,father_education,mother_occupation,father_occupation,No_of_siblings,promotion,state,district,block,promotion
Ankushkumar Maherwal,696969696969,,9999999999,Male,1991-11-02,West Bengal,696969696969 ,True,Class 7,Hindu,12345678,General,668,,,,,,,Maharashtra,Pune,Pune,,
2 changes: 1 addition & 1 deletion packages/admin/src/assets/images/FinalTeacher.csv
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
Name,Email Id,Mobile,Gender,DoB,board,Status,Classes taught,School Udise,Educational Qualification,Current role,Nature of appointment,Appointed Postname,Total Experience in teaching,Total experience as Head Teacher,Core subject taught,Attended In service teacher training,Last training attended (Topic),Last training attended (Year),Trained in use of computer & digital teaching
xyzabcd teacher xyz,,1234567890,female,1992-05-12,Maharashtra,true,Secondary,123456789,BA,teacher,NA,teacher,5,5,Science,no,,,yes
Ankushkumar Maherwal,,9878767678,Male,1992-05-12,Maharashtra,True,Secondary,123456789,Graduation,Teacher,Regular,TGTCBZ,2_5yrs,2_5yrs,Science,,,,
5 changes: 3 additions & 2 deletions packages/admin/src/components/DownloadCsv.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ const DownloadCsv = ({ open, handleClose }) => {
const token = sessionStorage.getItem("token");
const classes = await fetchClasses(
token,
dropdownValues.schoolNameDropdown
dropdownValues?.schoolNameDropdown?.label
);
console.log("classes", classes);
setClassOptions(classes);
Expand Down Expand Up @@ -209,7 +209,7 @@ const DownloadCsv = ({ open, handleClose }) => {
payload.filters.block = { eq: dropdownValues.blockDropdown?.label };
}
if (dropdownValues.schoolNameDropdown?.label) {
payload.filters.schoolName = { eq: dropdownValues.schoolNameDropdown?.label };
payload.filters.udiseCode = { eq: dropdownValues?.schoolNameDropdown?.udiseCode };
}
if (dropdownValues.classNameDropdown?.label) {
payload.filters.class = { eq: dropdownValues.classNameDropdown?.label };
Expand Down Expand Up @@ -452,6 +452,7 @@ const DownloadCsv = ({ open, handleClose }) => {
<Autocomplete
disablePortal
options={schoolOptions}
getOptionLabel={(option) => `${option?.label} (${option?.udiseCode})`}
value={dropdownValues.schoolNameDropdown} // Manage this state accordingly
onChange={(event, value) =>
handleChange(event, value, "schoolNameDropdown")
Expand Down
2 changes: 1 addition & 1 deletion packages/admin/src/components/StudentListView.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ function StudentListView() {
if (state) newFilters.state = { eq: state.label };
if (district) newFilters.district = { eq: district.label };
if (block) newFilters.block = { eq: block.label };
if (schoolName) newFilters.schoolName = { eq: schoolName.udiseCode };
if (schoolName) newFilters.udiseCode = { eq: schoolName?.udiseCode };
if (className) newFilters.class = { eq: className.label };

setFilters(newFilters);
Expand Down

0 comments on commit 380ccfc

Please sign in to comment.