stream doesn't want to work
This commit is contained in:
parent
d7ed57bbdd
commit
9656926a07
287 changed files with 6934 additions and 0 deletions
19
webroot/js/chat/register.js
Normal file
19
webroot/js/chat/register.js
Normal file
|
@ -0,0 +1,19 @@
|
|||
import { URL_CHAT_REGISTRATION } from '../utils/constants.js';
|
||||
|
||||
export async function registerChat(username) {
|
||||
const options = {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
body: JSON.stringify({ displayName: username }),
|
||||
};
|
||||
|
||||
try {
|
||||
const response = await fetch(URL_CHAT_REGISTRATION, options);
|
||||
const result = await response.json();
|
||||
return result;
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue