Merge branch 'server' into feat/matchmaking

This commit is contained in:
starnakin 2023-12-12 10:01:12 +01:00
commit ad6cfdf08a
2 changed files with 5 additions and 5 deletions

View File

@ -8,19 +8,19 @@ class Profile
this.user_id = user_id this.user_id = user_id
} }
async init(id) async init(user_id)
{ {
let response = await this.client._get(`/api/profiles/${id}`); let response = await this.client._get(`/api/profiles/${user_id}`);
let response_data = await response.json(); let response_data = await response.json();
this.id = id; this.user_id = user_id;
this.username = response_data.username; this.username = response_data.username;
this.avatar_url = response_data.avatar_url; this.avatar_url = response_data.avatar_url;
} }
async change_avatar(form_data) async change_avatar(form_data)
{ {
let response = await this.client._patch_file(`/api/profiles/${this.id}`, form_data); let response = await this.client._patch_file(`/api/profiles/${this.user_id}`, form_data);
let response_data = await response.json() let response_data = await response.json()
return response_data; return response_data;

View File

@ -86,7 +86,7 @@ const router = async (uri) => {
return 0; return 0;
}; };
window.addEventListener("popstate", function() {router(this.location.pathname)}); window.addEventListener("popstate", function() {router(location.pathname)});
document.addEventListener("DOMContentLoaded", () => { document.addEventListener("DOMContentLoaded", () => {
document.body.addEventListener("click", e => { document.body.addEventListener("click", e => {