Commit 9db2d9cbe39c62fcc5425d4c8f3143a9f355efba

Authored by Deepak
1 parent 167dd6325a
Exists in master

fixed error in csvupload

imports/collections/staff/methods.js
... ... @@ -76,7 +76,8 @@ export const staffAddNew = new ValidatedMethod({
76 76 specialization: data.specialization,
77 77 university: data.university,
78 78 degreeFrom: data.degreeFrom,
79   - degreeEnded: data.degreeEnded
  79 + degreeEnded: data.degreeEnded,
  80 + doj: data.doj
80 81 });
81 82 }
82 83 console.log("newStaffId");
... ...
imports/collections/students/index.js
... ... @@ -63,7 +63,7 @@ Students.deny({
63 63 Students.schema = new SimpleSchema({
64 64 userId: { type: String },
65 65 orgId: { type: String },
66   - admissionId: { type: String, optional: true ,unique: true,},
  66 + admissionId: { type: String, optional: true },
67 67 enrollmentDate: { type: String, optional: true },
68 68 address: { type: String, optional: true },
69 69 prefix: { type: String, optional: true },
... ...
imports/collections/students/serverCsvUpload.js
... ... @@ -36,7 +36,7 @@ export const save_csv_data = new ValidatedMethod({
36 36 validate: null,
37 37  
38 38 run({item,filename,csv_fiels}) {
39   -
  39 +
40 40 if ((item.length))
41 41 { console.log("++++++++++++++++++"+item.length)
42 42 var csv = json2csv({
... ... @@ -101,7 +101,7 @@ export const addStudentCSV= new ValidatedMethod({
101 101 bloodGroup: data['Blood Group*'],
102 102 nationality: data['Nationality*'],
103 103 motherTongue: data['Mother Tongue*'],
104   - religion: data['Religion*'],
  104 + religion: data['Religion*'],
105 105 community: data['Community'],
106 106  
107 107 rollNo: data['Student Roll*'],
... ... @@ -109,15 +109,15 @@ export const addStudentCSV= new ValidatedMethod({
109 109 section: data['Student Section Name*'],
110 110  
111 111 prevInstitute: [{ name: data['Previous Institution Name'],
112   - fromYear: data['Class-From'],
  112 + fromYear: data['Class-From'],
113 113 toYear: data['Class-To'],
114 114 fromClass: data['From-Year'],
115   - toClass: data['To-Year']
  115 + toClass: data['To-Year']
116 116 }],
117 117 permanentAddress: { street: data['Student Line Adress*'],
118   - city: data['Student City*'],
  118 + city: data['Student City*'],
119 119 state: data['Student State*'],
120   - zip: data['Student Zip Code*']
  120 + zip: data['Student Zip Code*']
121 121 },
122 122 parent: [{id: newParentUserId, relatinship: data['Parent Relation*']}]
123 123 });
... ... @@ -147,8 +147,8 @@ export const studentUploadCsv = new ValidatedMethod({
147 147 var CSV_valid_buffer = [];
148 148 var CSV_invalid_buffer = [];
149 149 var filename = "Student" + new Date().getTime().toString();
150   - var csv_filepath = '/Users/satheeshnagaraj/Documents/Workspace/Meteor/Youngdesk/ydapp/CSV_Files/';
151   -
  150 + var csv_filepath = '/Users/deepak/dev/yd/csv';
  151 +
152 152  
153 153  
154 154 for (let i = 0; i < data.length; i++)
... ... @@ -195,6 +195,10 @@ export const studentUploadCsv = new ValidatedMethod({
195 195 {
196 196 CSV_valid_buffer.push(item);
197 197 console.log("----------------------------------------1");
  198 + console.log("----------------------------------------item");
  199 + console.log(item);
  200 + console.log (Users.findOne({"firstName": item["First Name*"],"lastName": item["Last Name*"]}));
  201 +
198 202 Meteor.call('student.addCSV',item);
199 203 console.log("----------------------------------------2");
200 204  
... ...