Files
DoubleSnake/frontend/dashboard/account/index.js
2025-03-13 16:05:09 +01:00

20 lines
551 B
JavaScript

class AccountManager{
constructor(){
this.username = document.getElementById("username");
this.email = document.getElementById("email");
this.fullName = document.getElementById("fullName");
this.setUserData();
}
async setUserData(){
const respone = await fetch("/api/dashboard");
this.data = await respone.json();
this.username.value = this.data.username;
this.email.value = this.data.email;
this.fullName.value = this.data.fullName;
}
}
new AccountManager();