profiles: serializers representation to parse avatar url
This commit is contained in:
@ -25,10 +25,8 @@ class MyProfile extends Profile
|
||||
const response = await this.client._patch_file(`/api/profiles/settings`, formData);
|
||||
const responseData = await response.json();
|
||||
|
||||
if (response.ok) {
|
||||
this.avatar = responseData.avatar.substr(responseData.avatar.indexOf('static') - 1);
|
||||
if (response.ok)
|
||||
return null;
|
||||
}
|
||||
return responseData;
|
||||
}
|
||||
|
||||
@ -36,10 +34,8 @@ class MyProfile extends Profile
|
||||
const response = await this.client._delete('/api/profiles/settings');
|
||||
const responseData = await response.json();
|
||||
|
||||
if (response.ok) {
|
||||
this.avatar = responseData.avatar.substr(responseData.avatar.indexOf('static') - 1);
|
||||
if (response.ok)
|
||||
return null;
|
||||
}
|
||||
return responseData;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user