summaryrefslogtreecommitdiff
path: root/rushs/eplace/src/students
diff options
context:
space:
mode:
Diffstat (limited to 'rushs/eplace/src/students')
-rw-r--r--rushs/eplace/src/students/index.js19
-rw-r--r--rushs/eplace/src/students/utils.js5
2 files changed, 24 insertions, 0 deletions
diff --git a/rushs/eplace/src/students/index.js b/rushs/eplace/src/students/index.js
new file mode 100644
index 0000000..2aa18a2
--- /dev/null
+++ b/rushs/eplace/src/students/index.js
@@ -0,0 +1,19 @@
+// FIXME: This file should handle the students API
+// Functions may include:
+
+import { authedAPIRequest } from "../utils/auth";
+
+// - getStudent (get a student from the API by its uid or login)
+export async function getStudent(id) {
+ const response = await authedAPIRequest(`/students/${id}`, {
+ method: "get",
+ });
+
+ if (!response) {
+ return null;
+ } else {
+ return response.json();
+ }
+}
+// - getUserUidFromToken (get the user's uid from the token in local storage)
+// - updateStudent (update the student's profile through the API)
diff --git a/rushs/eplace/src/students/utils.js b/rushs/eplace/src/students/utils.js
new file mode 100644
index 0000000..09bb32e
--- /dev/null
+++ b/rushs/eplace/src/students/utils.js
@@ -0,0 +1,5 @@
+// FIXME: This file should handle the students DOM manipulation
+// Link buttons to their respective functions
+// Functions may include:
+// - displayStudentProfile (display the student's profile in the DOM)
+// - showModal (add a form modal to the DOM)