lms-sync 1.0.15 → 1.0.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/apiConnections/apiConnects.js +8 -14
 - package/apiConnections/mapping.js +369 -92
 - package/login.json +5 -0
 - package/models/sections.model.js +7 -7
 - package/package.json +1 -1
 - package/recordError.log +4810 -0
 - package/recordSuccess.log +14092 -0
 - package/target.json +9 -0
 
| 
         @@ -137,17 +137,6 @@ const Apis = { 
     | 
|
| 
       137 
137 
     | 
    
         
             
                        //fetch the access token from the login
         
     | 
| 
       138 
138 
     | 
    
         
             
                        const { login, apis } = await this.Login();
         
     | 
| 
       139 
139 
     | 
    
         | 
| 
       140 
     | 
    
         
            -
                        //get the current date
         
     | 
| 
       141 
     | 
    
         
            -
                        // let defaultDate = new Date()
         
     | 
| 
       142 
     | 
    
         
            -
             
     | 
| 
       143 
     | 
    
         
            -
                        // //get the current year
         
     | 
| 
       144 
     | 
    
         
            -
                        // let currentYear = defaultDate.getFullYear()
         
     | 
| 
       145 
     | 
    
         
            -
             
     | 
| 
       146 
     | 
    
         
            -
                        // //get the current year and minus it to 1 for the previous year
         
     | 
| 
       147 
     | 
    
         
            -
                        // let previousYear = currentYear - 1
         
     | 
| 
       148 
     | 
    
         
            -
             
     | 
| 
       149 
     | 
    
         
            -
                        // let fromPrompts = await semesterPick.Picked()
         
     | 
| 
       150 
     | 
    
         
            -
             
     | 
| 
       151 
140 
     | 
    
         
             
                        let fromPrompts = await Picked()
         
     | 
| 
       152 
141 
     | 
    
         | 
| 
       153 
142 
     | 
    
         
             
                        let semester = fromPrompts.semester
         
     | 
| 
         @@ -178,12 +167,15 @@ const Apis = { 
     | 
|
| 
       178 
167 
     | 
    
         
             
                async Subject(){
         
     | 
| 
       179 
168 
     | 
    
         
             
                    try {
         
     | 
| 
       180 
169 
     | 
    
         
             
                        const { login, apis } = await this.Login();
         
     | 
| 
       181 
     | 
    
         
            -
                        const  
     | 
| 
      
 170 
     | 
    
         
            +
                        const {currentSchoolYear, semester, acadYearResult} = await this.AcademicYear()
         
     | 
| 
      
 171 
     | 
    
         
            +
             
     | 
| 
      
 172 
     | 
    
         
            +
                        let foundAcadYear = acadYearResult.find(ay => ay.year === currentSchoolYear && ay.term === semester);
         
     | 
| 
      
 173 
     | 
    
         
            +
                        
         
     | 
| 
      
 174 
     | 
    
         
            +
                        const subjectResult = await apis.instance.get(`/subjects?academic_year_id=${foundAcadYear.id}`, {
         
     | 
| 
       182 
175 
     | 
    
         
             
                            headers: {
         
     | 
| 
       183 
176 
     | 
    
         
             
                               'Authorization': `Bearer ${login}`
         
     | 
| 
       184 
177 
     | 
    
         
             
                            }
         
     | 
| 
       185 
178 
     | 
    
         
             
                        });
         
     | 
| 
       186 
     | 
    
         
            -
                        // console.log('subjectResult.data :>> ', subjectResult.data);
         
     | 
| 
       187 
179 
     | 
    
         
             
                        return subjectResult.data
         
     | 
| 
       188 
180 
     | 
    
         
             
                    } catch (error) {
         
     | 
| 
       189 
181 
     | 
    
         
             
                        console.error('Instructor Api Error:', error);
         
     | 
| 
         @@ -195,8 +187,10 @@ const Apis = { 
     | 
|
| 
       195 
187 
     | 
    
         
             
                    try {
         
     | 
| 
       196 
188 
     | 
    
         
             
                        //fetch the access token from the login
         
     | 
| 
       197 
189 
     | 
    
         
             
                        const { login, apis } = await this.Login();
         
     | 
| 
      
 190 
     | 
    
         
            +
                        const {currentSchoolYear, semester, acadYearResult} = await this.AcademicYear()
         
     | 
| 
      
 191 
     | 
    
         
            +
                        let foundAcadYear = acadYearResult.find(ay => ay.year === currentSchoolYear && ay.term === semester);
         
     | 
| 
       198 
192 
     | 
    
         | 
| 
       199 
     | 
    
         
            -
                        const schedule = await apis.instance.get( 
     | 
| 
      
 193 
     | 
    
         
            +
                        const schedule = await apis.instance.get(`/subjects?academic_year_id=${foundAcadYear.id}`,
         
     | 
| 
       200 
194 
     | 
    
         
             
                        {
         
     | 
| 
       201 
195 
     | 
    
         
             
                            headers: {
         
     | 
| 
       202 
196 
     | 
    
         
             
                                'Authorization': `Bearer ${login}`
         
     |