update username

This commit is contained in:
realaravinth
2021-08-13 18:58:04 +05:30
parent 595e79a014
commit 6ef941f73d
13 changed files with 238 additions and 171 deletions

View File

@@ -20,8 +20,14 @@ import ROUTES from '../../../api/v1/routes';
import genJsonPayload from '../../../utils/genJsonPayload';
import createError from '../../../components/error/index';
const userExists = async () => {
const username = <HTMLInputElement>document.getElementById('username');
const userExists = async (element?: HTMLInputElement) => {
console.log(element);
let username;
if (element === undefined) {
username = <HTMLInputElement>document.getElementById('username');
} else {
username = element;
}
const val = username.value;
const payload = {
val,