diff options
| author | Martial Simon <msimon_fr@hotmail.com> | 2025-09-15 01:08:27 +0200 |
|---|---|---|
| committer | Martial Simon <msimon_fr@hotmail.com> | 2025-09-15 01:08:27 +0200 |
| commit | c9b6b9a5ca082fe7c1b6f58d7713f785a9eb6a5c (patch) | |
| tree | 3e4f42f93c7ae89a364e4d51fff6e5cec4e55fa9 /rushs/eplace/src/students/index.js | |
add: graphs et rushs
Diffstat (limited to 'rushs/eplace/src/students/index.js')
| -rw-r--r-- | rushs/eplace/src/students/index.js | 19 |
1 files changed, 19 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) |
