blob: 2aa18a205117a34c72dc4b34369da41b65708a08 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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)
|