diff --git a/imports/collections/staff/methods.js b/imports/collections/staff/methods.js index e4b268e..6c56581 100644 --- a/imports/collections/staff/methods.js +++ b/imports/collections/staff/methods.js @@ -76,7 +76,8 @@ export const staffAddNew = new ValidatedMethod({ specialization: data.specialization, university: data.university, degreeFrom: data.degreeFrom, - degreeEnded: data.degreeEnded + degreeEnded: data.degreeEnded, + doj: data.doj }); } console.log("newStaffId"); diff --git a/imports/collections/students/index.js b/imports/collections/students/index.js index 774e39f..93e3ddb 100644 --- a/imports/collections/students/index.js +++ b/imports/collections/students/index.js @@ -63,7 +63,7 @@ Students.deny({ Students.schema = new SimpleSchema({ userId: { type: String }, orgId: { type: String }, - admissionId: { type: String, optional: true ,unique: true,}, + admissionId: { type: String, optional: true }, enrollmentDate: { type: String, optional: true }, address: { type: String, optional: true }, prefix: { type: String, optional: true }, diff --git a/imports/collections/students/serverCsvUpload.js b/imports/collections/students/serverCsvUpload.js index 09c4752..b198f07 100644 --- a/imports/collections/students/serverCsvUpload.js +++ b/imports/collections/students/serverCsvUpload.js @@ -36,7 +36,7 @@ export const save_csv_data = new ValidatedMethod({ validate: null, run({item,filename,csv_fiels}) { - + if ((item.length)) { console.log("++++++++++++++++++"+item.length) var csv = json2csv({ @@ -101,7 +101,7 @@ export const addStudentCSV= new ValidatedMethod({ bloodGroup: data['Blood Group*'], nationality: data['Nationality*'], motherTongue: data['Mother Tongue*'], - religion: data['Religion*'], + religion: data['Religion*'], community: data['Community'], rollNo: data['Student Roll*'], @@ -109,15 +109,15 @@ export const addStudentCSV= new ValidatedMethod({ section: data['Student Section Name*'], prevInstitute: [{ name: data['Previous Institution Name'], - fromYear: data['Class-From'], + fromYear: data['Class-From'], toYear: data['Class-To'], fromClass: data['From-Year'], - toClass: data['To-Year'] + toClass: data['To-Year'] }], permanentAddress: { street: data['Student Line Adress*'], - city: data['Student City*'], + city: data['Student City*'], state: data['Student State*'], - zip: data['Student Zip Code*'] + zip: data['Student Zip Code*'] }, parent: [{id: newParentUserId, relatinship: data['Parent Relation*']}] }); @@ -147,8 +147,8 @@ export const studentUploadCsv = new ValidatedMethod({ var CSV_valid_buffer = []; var CSV_invalid_buffer = []; var filename = "Student" + new Date().getTime().toString(); - var csv_filepath = '/Users/satheeshnagaraj/Documents/Workspace/Meteor/Youngdesk/ydapp/CSV_Files/'; - + var csv_filepath = '/Users/deepak/dev/yd/csv'; + for (let i = 0; i < data.length; i++) @@ -195,6 +195,10 @@ export const studentUploadCsv = new ValidatedMethod({ { CSV_valid_buffer.push(item); console.log("----------------------------------------1"); + console.log("----------------------------------------item"); + console.log(item); + console.log (Users.findOne({"firstName": item["First Name*"],"lastName": item["Last Name*"]})); + Meteor.call('student.addCSV',item); console.log("----------------------------------------2");