Added website image to the creator page and use type of file when uploading pictures. Restriction for .png, .jpeg, .jpg for now
This commit is contained in:
@@ -28,7 +28,7 @@ export const useUserStore = defineStore('user', () => {
|
||||
const updateProfilePictureEndpoint = haveNewProfilePicture ? `/api/UpdateMyUser/profile-picture` : `/api/UpdateMyUser/profile-picture?url=${myUserModel.storedDataUrls.profilePictureUrl}`;
|
||||
const response = await client.post(updateProfilePictureEndpoint, profilePicture, {
|
||||
headers: {
|
||||
'Content-Type': 'application/octet-stream',
|
||||
'Content-Type': profilePicture?.type ?? "application/stream-octet",
|
||||
}
|
||||
});
|
||||
|
||||
@@ -38,14 +38,16 @@ export const useUserStore = defineStore('user', () => {
|
||||
}
|
||||
if (typeof myUserModel.storedDataUrls.bannerPictureUrl !== "object") {
|
||||
const haveNewBannerPicture = bannerPicture !== null && bannerPicture.size !== 0;
|
||||
|
||||
|
||||
const updateBannerPictureEndpoint = haveNewBannerPicture ? `/api/UpdateMyUser/banner-picture` : `/api/UpdateMyUser/banner-picture?url=${myUserModel.storedDataUrls.bannerPictureUrl}`;
|
||||
const response = await client.post(updateBannerPictureEndpoint, bannerPicture, {
|
||||
headers: {
|
||||
'Content-Type': 'application/octet-stream',
|
||||
'Content-Type': bannerPicture?.type ?? "application/stream-octet",
|
||||
}
|
||||
});
|
||||
|
||||
console.log(response);
|
||||
|
||||
if (haveNewBannerPicture) {
|
||||
this.user.value.storedDataUrls.bannerPictureUrl = response.data;
|
||||
}
|
||||
@@ -56,7 +58,7 @@ export const useUserStore = defineStore('user', () => {
|
||||
const updateWebsiteIconEndpoint = haveNewWebsiteIcon ? `/api/UpdateMyUser/website-icon` : `/api/UpdateMyUser/website-icon?url=${myUserModel.storedDataUrls.websiteIconUrl}`;
|
||||
const response = await client.post(updateWebsiteIconEndpoint, websiteIcon, {
|
||||
headers: {
|
||||
'Content-Type': 'application/octet-stream',
|
||||
'Content-Type': websiteIcon?.type ?? "application/stream-octet",
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user