Add vite react #45

Closed
lukas wants to merge 42 commits from add-frontend into main
1 changed files with 17 additions and 0 deletions
Showing only changes of commit 5756b736d8 - Show all commits

View File

@ -0,0 +1,17 @@
export async function api(url) {
const response = await fetch(url);
if (response.ok) {
const jsonValue = await response.json();
return Promise.resolve(jsonValue);
} else {
return Promise.reject('Response was not OK.');
}
}
export async function getSession(sessionId) {
return await api(`/api/sessions/${sessionId}/`);
}
export async function getSessionList() {
return await api(`/api/sessions/`);
}