@itutoring/itutoring_application_js_api 1.2.3 → 1.2.4

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.
@@ -0,0 +1,39 @@
1
+ import APIController from "../apiController";
2
+ import AttendanceEvent from "../objects/AttendanceEvent";
3
+
4
+ class AttendanceManager
5
+ {
6
+ static #MODULE = "AttendanceManager";
7
+
8
+ static #RETRIVE_ALL_EVENTS = "RetriveAllEvents";
9
+ static #UPDATE_EVENT = "UpdateEvent";
10
+
11
+ static async RetriveAllEvents()
12
+ {
13
+ var data = await APIController.Get(this.#MODULE, this.#RETRIVE_ALL_EVENTS);
14
+
15
+ var events = [];
16
+ for (const [key, value] of Object.entries(data))
17
+ {
18
+ var atEvents = []
19
+ for (const [k1, v1] of Object.entries(value))
20
+ {
21
+ var ev = new AttendanceEvent();
22
+ ev.CreateFromJSON(JSON.parse(v1));
23
+ atEvents.push(ev);
24
+ }
25
+ events.push(atEvents);
26
+ }
27
+
28
+ return events;
29
+ }
30
+
31
+ static async UpdateEvent(event)
32
+ {
33
+ await APIController.Post(this.#MODULE, this.#UPDATE_EVENT, {
34
+ 'event': JSON.stringify(event),
35
+ });
36
+ }
37
+ }
38
+
39
+ export default AttendanceManager;
@@ -0,0 +1,21 @@
1
+ class AttendanceEvent
2
+ {
3
+ Date;
4
+ Presence;
5
+ Note;
6
+ ID;
7
+ EventName;
8
+ Subject
9
+
10
+ CreateFromJSON(json)
11
+ {
12
+ this.Date = json['Date'];
13
+ this.Presence = json['Presence'];
14
+ this.Note = json['Note'];
15
+ this.ID = json['ID'];
16
+ this.EventName = json['EventName'];
17
+ this.Subject = json['Subject'];
18
+ }
19
+ }
20
+
21
+ export default AttendanceEvent;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@itutoring/itutoring_application_js_api",
3
- "version": "1.2.3",
3
+ "version": "1.2.4",
4
4
  "description": "Javascript API for iTutoring Application",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",