Adds ChangeBanner for Creators
This commit is contained in:
@@ -52,26 +52,5 @@ export const useUserStore = defineStore(
|
||||
}
|
||||
}
|
||||
|
||||
async function updateCurrentUser(userModel, profilePicture) {
|
||||
const client = useClient()
|
||||
await client.patch("/api/UpdateMyUser/profile", userModel)
|
||||
|
||||
if (typeof userModel.storedDataUrls.profilePictureUrl !== "object") {
|
||||
const haveNewProfilePicture = profilePicture !== null && profilePicture.size !== 0;
|
||||
const updateProfilePictureEndpoint = haveNewProfilePicture ? `/api/UpdateMyUser/profile-picture` : `/api/UpdateMyUser/profile-picture?url=${userModel.storedDataUrls.profilePictureUrl}`;
|
||||
const response = await client.post(updateProfilePictureEndpoint, profilePicture, {
|
||||
headers: {
|
||||
'Content-Type': profilePicture?.type ?? "application/octet-stream",
|
||||
}
|
||||
});
|
||||
|
||||
if (haveNewProfilePicture) {
|
||||
this.user.value.portraitUrl = response.data;
|
||||
}
|
||||
}
|
||||
|
||||
this.user.value = userModel;
|
||||
}
|
||||
|
||||
return {user, creator, alias, portraitUrl}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user