ux: Me becomes Settings; backend: fix special usernames (me, block...)

This commit is contained in:
AdrienLSH
2024-02-08 10:09:36 +01:00
parent 1dea678a04
commit 55d3ea40f6
11 changed files with 17 additions and 18 deletions

View File

@ -9,7 +9,7 @@ class MyProfile extends Profile
*/
constructor (client)
{
super(client, "me")
super(client, "../me")
}
/**
@ -19,7 +19,7 @@ class MyProfile extends Profile
*/
async change_avatar(form_data)
{
let response = await this.client._patch_file(`/api/profiles/me`, form_data);
let response = await this.client._patch_file(`/api/profiles/settings`, form_data);
let response_data = await response.json()
return response_data;
@ -27,4 +27,4 @@ class MyProfile extends Profile
}
export {MyProfile}
export {MyProfile}

View File

@ -150,7 +150,7 @@ class Client
async _patch_json(uri, data)
{
let response = await fetch(this._url + uri, {
ethod: "PATCH",
method: "PATCH",
headers: {
"X-CSRFToken": getCookie("csrftoken"),
"Content-Type": "application/json",

View File

@ -42,7 +42,7 @@ class Profile
{
let response;
if (this.username !== undefined)
response = await this.client._get(`/api/profiles/${this.username}`);
response = await this.client._get(`/api/profiles/user/${this.username}`);
else
response = await this.client._get(`/api/profiles/id/${this.id}`);