hinzufügen von wörtern

This commit is contained in:
adrian
2025-12-04 23:13:04 +01:00
parent 3dd6b3ff36
commit 93aca73e55
7 changed files with 65 additions and 0 deletions

View File

@ -9,3 +9,20 @@ function re_direct () {
window.location.href = `/${encodedSession}/${encodedUser}`;
}
async function addWord() {
const word = document.getElementById('word').value.trim();
const imposterWord = document.getElementById('imposterWord').value.trim();
const data = {
word: word,
imposterWord: imposterWord,
}
const res = await fetch (`/api/words/add`, {
method: 'PUT',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify(data)
});
}