Adds ChangeBanner for Creators

This commit is contained in:
Jonathan Bourdon
2024-08-05 16:34:09 -04:00
parent 743bfea56e
commit bd30b58463
5 changed files with 140 additions and 167 deletions

View File

@@ -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}
})