From c9b6b9a5ca082fe7c1b6f58d7713f785a9eb6a5c Mon Sep 17 00:00:00 2001 From: Martial Simon Date: Mon, 15 Sep 2025 01:08:27 +0200 Subject: add: graphs et rushs --- rushs/eplace/src/students/index.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 rushs/eplace/src/students/index.js (limited to 'rushs/eplace/src/students/index.js') 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) -- cgit v1.2.3