@itutoring/itutoring_application_js_api 1.1.1 → 1.1.3

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/index.d.ts CHANGED
@@ -17,6 +17,7 @@ import TeacherAuth from "./modules/TeacherAuth";
17
17
  import TeacherManager from "./modules/TeacherManager";
18
18
  import TeacherPortal from "./modules/TeacherPortal";
19
19
  import TeacherProfiles from "./modules/TeacherProfiles";
20
+ import WebinarSystem from "./modules/WebinarsSystem";
20
21
 
21
22
  import Course from "./objects/Course";
22
23
  import CourseReservation from "./objects/CourseReservation";
@@ -53,6 +54,7 @@ export
53
54
  TeacherManager,
54
55
  TeacherPortal,
55
56
  TeacherProfiles,
57
+ WebinarSystem,
56
58
 
57
59
  Course,
58
60
  CourseReservation,
package/index.js CHANGED
@@ -15,6 +15,7 @@ import TeacherAuth from "./modules/TeacherAuth";
15
15
  import TeacherManager from "./modules/TeacherManager";
16
16
  import TeacherPortal from "./modules/TeacherPortal";
17
17
  import TeacherProfiles from "./modules/TeacherProfiles";
18
+ import WebinarSystem from "./modules/WebinarsSystem";
18
19
 
19
20
  import Course from "./objects/Course";
20
21
  import CourseReservation from "./objects/CourseReservation";
@@ -51,6 +52,7 @@ export
51
52
  TeacherManager,
52
53
  TeacherPortal,
53
54
  TeacherProfiles,
55
+ WebinarSystem,
54
56
 
55
57
  Course,
56
58
  CourseReservation,
@@ -1,4 +1,5 @@
1
1
  import APIController from "../apiController"
2
+ import Webinar from "../objects/Webinar";
2
3
 
3
4
  class WebinarSystem
4
5
  {
@@ -9,15 +10,44 @@ class WebinarSystem
9
10
 
10
11
  // All method names
11
12
  static #REGISTER = "Register"
13
+ static #GET_ALL_WEBINARS = "GetAllWebinars";
12
14
 
13
- static async Register(email)
15
+ static async Register(email, webinarId)
14
16
  {
15
17
  var res = await APIController.Post(this.#MODULE, this.#REGISTER, {
16
18
  "email": email,
19
+ "id": webinarId
17
20
  });
18
21
 
19
22
  return APIController.IntToBool(res);
20
23
  }
24
+
25
+ static async GetAllWebinars()
26
+ {
27
+ var data = await APIController.Get(this.#MODULE, this.#GET_ALL_WEBINARS);
28
+
29
+ var dataArray = JSON.parse(data);
30
+ var webinars = [];
31
+
32
+ for (const [key, value] of Object.entries(dataArray))
33
+ {
34
+ var webinar = new Webinar();
35
+ webinar.Name = value['Name'];
36
+ webinar.Description = value['Description'];
37
+ webinar.ID = value['ID']
38
+ webinar.Program = value['Program'];
39
+ webinar.Date = value['Date'];
40
+ webinar.StartTime = value['StartTime'];
41
+ webinar.EndTime = value['EndTime'];
42
+ webinar.TeacherId = value['TeacherId'];
43
+ webinar.TeacherRole = value['TeacherRole'];
44
+ webinar.Price = value['Price'];
45
+
46
+ webinars[webinar.ID] = webinar;
47
+ }
48
+
49
+ return webinar;
50
+ }
21
51
  }
22
52
 
23
53
  export default WebinarSystem;
@@ -0,0 +1,15 @@
1
+ class Webinar
2
+ {
3
+ Name;
4
+ Description;
5
+ Program;
6
+ Date;
7
+ StartTime;
8
+ EndTime;
9
+ TeacherId;
10
+ TeacherRole;
11
+ Price;
12
+ ID;
13
+ }
14
+
15
+ export default Webinar;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@itutoring/itutoring_application_js_api",
3
- "version": "1.1.1",
3
+ "version": "1.1.3",
4
4
  "description": "Javascript API for iTutoring Application",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",