Enable clearing of user avatar
This commit is contained in:
@@ -142,6 +142,19 @@ function create() {
|
||||
|
||||
return null;
|
||||
},
|
||||
async unsetAvatar() {
|
||||
let error, result;
|
||||
try {
|
||||
result = await fetcher.del(`${API_ORIGIN}/api/v1/profile/avatar`, null, { access_token: accessToken });
|
||||
} catch (e) {
|
||||
error = e;
|
||||
}
|
||||
|
||||
if (error) return error;
|
||||
if (result.status !== 204) return result;
|
||||
|
||||
return null;
|
||||
},
|
||||
async setBackgroundImage(file) {
|
||||
const fd = new FormData();
|
||||
if (file) fd.append('backgroundImage', file);
|
||||
|
||||
Reference in New Issue
Block a user