@itutoring/itutoring_application_js_api 1.1.2 → 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.
@@ -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.2",
3
+ "version": "1.1.3",
4
4
  "description": "Javascript API for iTutoring Application",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",