imposter get

This commit is contained in:
adrian
2025-12-05 21:29:26 +01:00
parent bcc70458ae
commit f8a67c1dfb
3 changed files with 32 additions and 4 deletions

View File

@ -12,10 +12,20 @@ async function show_user() {
const users = await res.json();
const allUsers = users.map((u) => u.state);
if (allUsers.every((v) => v === 0)) {
console.log("test");
async function createImposter() {
const res = await fetch(`/api/${sessionId}/${username}/createImposter`);
}
}
}
async function createImposter() {
const res = await fetch(`/api/${sessionId}/${username}/createImposter`);
async function getImposter() {
const res = await fetch(`/api/${sessionId}/${username}/getImposter`);
const stateObj = await res.json();
state = stateObj.state;
if (state == 1) {
console.log("du bist imposter");
} else {
console.log("du bist kein imposter");
}
}