@itutoring/itutoring_application_js_api 1.0.8 → 1.0.10

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/apiController.js CHANGED
@@ -171,7 +171,14 @@ class APIController
171
171
  resolve(APIController.#CLIENT_KEY);
172
172
  }
173
173
 
174
- fetch('/client_key.xml').then(response => response.text()).then((data) =>
174
+ let keyPath = '/client_key.xml';
175
+ // For localhost use different xml file (to make suer we won't revwrite the server key when uploading websites)
176
+ if (location.hostname === "localhost")
177
+ {
178
+ keyPath = '/local_client_key.xml'
179
+ }
180
+
181
+ fetch(keyPath).then(response => response.text()).then((data) =>
175
182
  {
176
183
  var parser = new DOMParser();
177
184
  var keyXML = parser.parseFromString(data, "text/xml");
@@ -180,6 +187,7 @@ class APIController
180
187
  APIController.#CLIENT_KEY = key;
181
188
  resolve(APIController.#CLIENT_KEY);
182
189
  });
190
+
183
191
  });
184
192
  }
185
193
 
@@ -20,6 +20,21 @@ class TeacherPortal
20
20
  static #GET_RESERVATIONS = "GetReservations";
21
21
  static #SET_BITMOJI = "SetBitmoji";
22
22
  static #HAS_BITMOJI = "HasBitmoji";
23
+ static #TAKE_RESERVATION = "TakeReservation";
24
+
25
+ /**
26
+ *
27
+ * @param {*} id Reservation id
28
+ * @returns bool
29
+ */
30
+ static async TakeReservation(id)
31
+ {
32
+ var res = await APIController.Get(this.#MODULE, this.#TAKE_RESERVATION, {
33
+ 'id': id,
34
+ });
35
+
36
+ return APIController.IntToBool(res);
37
+ }
23
38
 
24
39
  static async HasBitmoji()
25
40
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@itutoring/itutoring_application_js_api",
3
- "version": "1.0.8",
3
+ "version": "1.0.10",
4
4
  "description": "Javascript API for iTutoring Application",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",