ux: Me becomes Settings; backend: fix special usernames (me, block...)
This commit is contained in:
@ -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}
|
||||
|
@ -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",
|
||||
|
@ -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}`);
|
||||
|
||||
|
Reference in New Issue
Block a user