Prettified Code!

This commit is contained in:
gabek
2021-07-20 02:23:06 +00:00
committed by GitHub Action
parent b6f68628c0
commit 7af5030f5b
10 changed files with 142 additions and 93 deletions

View File

@@ -1,19 +1,19 @@
import {URL_CHAT_REGISTRATION} from "../utils/constants.js";
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})
}
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);
}
}
try {
const response = await fetch(URL_CHAT_REGISTRATION, options);
const result = await response.json();
return result;
} catch (e) {
console.error(e);
}
}