Prettified Code!
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user