Added images

This commit is contained in:
Dominic Villemure
2024-06-30 23:39:56 -04:00
parent 169e2cc160
commit 5f54b69e00
7 changed files with 160 additions and 82 deletions

View File

@@ -18,9 +18,27 @@ export const useUserStore = defineStore('user', () => {
}
}
async function updateCurrentUser(client, myUserModel) {
async function updateCurrentUser(client, myUserModel, profilePicture, bannerPicture, websiteIcon) {
this.user.value = myUserModel;
await client.patch("/api/UpdateMyUser/profile", myUserModel)
this.user.value.storedDataUrls.profilePictureUrl = await client.post("/api/UpdateMyUser/profile-picture", profilePicture, {
headers: {
'Content-Type': 'application/octet-stream',
}
});
this.user.value.storedDataUrls.bannerPictureUrl = await client.post("/api/UpdateMyUser/banner-picture", bannerPicture, {
headers: {
'Content-Type': 'application/octet-stream',
}
});
this.user.value.storedDataUrls.websiteIconUrl = await client.post("/api/UpdateMyUser/website-icon", websiteIcon, {
headers: {
'Content-Type': 'application/octet-stream',
}
});
}
return { user, getCurrentUser, setCurrentUser, updateCurrentUser }