Enable clearing of user avatar

This commit is contained in:
Johannes Zellner
2025-07-16 18:56:00 +02:00
parent b1752de36f
commit 696632e551
2 changed files with 19 additions and 1 deletions
+13
View File
@@ -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);