@itutoring/itutoring_application_js_api 1.0.23 → 1.0.25

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2022 iTutoring s.r.o.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/apiController.js CHANGED
@@ -95,7 +95,11 @@ class APIController
95
95
  var formData = new FormData();
96
96
  if (file != null)
97
97
  {
98
+ console.log("api - U_F");
98
99
  var formData = new FormData();
100
+ formData.append("file", file);
101
+
102
+
99
103
  }
100
104
 
101
105
  var args = APIController.GetArgsFromArray(data);
@@ -1,3 +1,4 @@
1
+ import TeacherProfile from "../objects/TeacherProfile";
1
2
  import APIController from "./../apiController";
2
3
  import Teacher from "./../objects/Teacher";
3
4
 
@@ -37,12 +38,12 @@ class TeacherManager
37
38
  static async GetAllTeachers()
38
39
  {
39
40
  var teachers = await APIController.Get(this.#MODULE, this.#GET_ALL_TEACHERS);
40
-
41
+
41
42
  var teachersArray = JSON.parse(teachers);
42
43
 
43
44
  var teachersClasses = [];
44
45
 
45
- for (const[key, value] of Object.entries(teachersArray))
46
+ for (const [key, value] of Object.entries(teachersArray))
46
47
  {
47
48
  var teacher = new Teacher;
48
49
 
@@ -53,6 +54,13 @@ class TeacherManager
53
54
  teacher.TeachedLessons = value['TeachedLessons'];
54
55
  teacher.Admin = APIController.IntToBool(value['Admin']);
55
56
 
57
+ var teacherProfile = new TeacherProfile();
58
+ teacherProfile.Bio = value['Profile']['Bio'];
59
+ teacherProfile.Name = value['Profile']['Name'];
60
+ teacherProfile.PhotoPath = value['Profile']['PhotoPath'];
61
+
62
+ teacher.TeacherProfile = teacherProfile;
63
+
56
64
  teachersClasses[teacher.ID] = teacher;
57
65
  }
58
66
 
@@ -1,3 +1,4 @@
1
+ import TeacherProfile from "../objects/TeacherProfile";
1
2
  import APIController from "./../apiController";
2
3
  import Reservation from "./../objects/Reservation";
3
4
  import Teacher from "./../objects/Teacher";
@@ -135,6 +136,13 @@ class TeacherPortal
135
136
  teacher.Admin = teacherArray['Admin'];
136
137
  teacher.BitmojiURL = decodeURIComponent(teacherArray['BitmojiURL']);
137
138
 
139
+ var teacherProfile = new TeacherProfile();
140
+ teacherProfile.Bio = teacherArray['Profile']['Bio'];
141
+ teacherProfile.Name = teacherArray['Profile']['Name'];
142
+ teacherProfile.PhotoPath = teacherArray['Profile']['PhotoPath'];
143
+
144
+ teacher.TeacherProfile = teacherProfile;
145
+
138
146
  return teacher;
139
147
  }
140
148
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@itutoring/itutoring_application_js_api",
3
- "version": "1.0.23",
3
+ "version": "1.0.25",
4
4
  "description": "Javascript API for iTutoring Application",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",