From 973653158d73f71ccf0d23498526d32f0e4ba8e1 Mon Sep 17 00:00:00 2001 From: Dominic Villemure Date: Thu, 4 Jul 2024 22:42:53 -0400 Subject: [PATCH 1/9] Banner + profilePicture + mapped socialNetworks url into the creator.vue --- src/views/main/Creator.vue | 82 +++++++++++++---------- src/views/main/CreatorBanner.vue | 111 +++++++++++++++++++++++++++++++ src/views/main/Header.vue | 2 +- 3 files changed, 160 insertions(+), 35 deletions(-) create mode 100644 src/views/main/CreatorBanner.vue diff --git a/src/views/main/Creator.vue b/src/views/main/Creator.vue index d608ba2..38e804a 100644 --- a/src/views/main/Creator.vue +++ b/src/views/main/Creator.vue @@ -1,49 +1,63 @@ - diff --git a/src/views/main/CreatorBanner.vue b/src/views/main/CreatorBanner.vue new file mode 100644 index 0000000..9ad5749 --- /dev/null +++ b/src/views/main/CreatorBanner.vue @@ -0,0 +1,111 @@ + + + \ No newline at end of file diff --git a/src/views/main/Header.vue b/src/views/main/Header.vue index 7e5b01c..4abb414 100644 --- a/src/views/main/Header.vue +++ b/src/views/main/Header.vue @@ -74,7 +74,7 @@
- + {{ currentUserName }} From 5eccb68c2e0e6bb71cea13ebea1cddb9d03f2b16 Mon Sep 17 00:00:00 2001 From: Dominic Villemure Date: Thu, 4 Jul 2024 23:37:08 -0400 Subject: [PATCH 2/9] Fix little problem with updating image once at the time --- src/stores/user.js | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/stores/user.js b/src/stores/user.js index 1512730..a0f2769 100644 --- a/src/stores/user.js +++ b/src/stores/user.js @@ -22,19 +22,23 @@ export const useUserStore = defineStore('user', () => { this.user.value = myUserModel; await client.patch("/api/UpdateMyUser/profile", myUserModel) - this.user.value.storedDataUrls.profilePictureUrl = await client.post("/api/UpdateMyUser/profile-picture", profilePicture, { + const updateProfilePictureEndpoint = profilePicture !== null && profilePicture.size !== 0 ? `/api/UpdateMyUser/profile-picture` : `/api/UpdateMyUser/profile-picture?url=${myUserModel.storedDataUrls.profilePictureUrl}`; + this.user.value.storedDataUrls.profilePictureUrl = await client.post(updateProfilePictureEndpoint, profilePicture, { + headers: { + 'Content-Type': 'application/octet-stream', + } + }); + + const updateBannerPictureEndpoint = bannerPicture !== null && bannerPicture.size !== 0 ? `/api/UpdateMyUser/banner-picture` : `/api/UpdateMyUser/banner-picture?url=${myUserModel.storedDataUrls.bannerPictureUrl}`; + this.user.value.storedDataUrls.bannerPictureUrl = await client.post(updateBannerPictureEndpoint, bannerPicture, { 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, { + console.log(websiteIcon); + const updateWebsiteIconEndpoint = websiteIcon !== null && websiteIcon.size !== 0 ? `/api/UpdateMyUser/website-icon` : `/api/UpdateMyUser/website-icon?url=${myUserModel.storedDataUrls.websiteIconUrl}`; + this.user.value.storedDataUrls.websiteIconUrl = await client.post(updateWebsiteIconEndpoint, websiteIcon, { headers: { 'Content-Type': 'application/octet-stream', } From fb57d633df413da4852f75a00c4a4bdf2e3ec1d4 Mon Sep 17 00:00:00 2001 From: Dominic Villemure Date: Fri, 5 Jul 2024 00:11:11 -0400 Subject: [PATCH 3/9] Added back stripePayment with the userId. Colors on the banner + accent on the profile picture and name --- src/stores/user.js | 45 +++++++++++++++++--------------- src/views/main/Creator.vue | 7 ++--- src/views/main/CreatorBanner.vue | 19 +++++++++----- 3 files changed, 41 insertions(+), 30 deletions(-) diff --git a/src/stores/user.js b/src/stores/user.js index a0f2769..30e23f6 100644 --- a/src/stores/user.js +++ b/src/stores/user.js @@ -22,27 +22,30 @@ export const useUserStore = defineStore('user', () => { this.user.value = myUserModel; await client.patch("/api/UpdateMyUser/profile", myUserModel) - const updateProfilePictureEndpoint = profilePicture !== null && profilePicture.size !== 0 ? `/api/UpdateMyUser/profile-picture` : `/api/UpdateMyUser/profile-picture?url=${myUserModel.storedDataUrls.profilePictureUrl}`; - this.user.value.storedDataUrls.profilePictureUrl = await client.post(updateProfilePictureEndpoint, profilePicture, { - headers: { - 'Content-Type': 'application/octet-stream', - } - }); - - const updateBannerPictureEndpoint = bannerPicture !== null && bannerPicture.size !== 0 ? `/api/UpdateMyUser/banner-picture` : `/api/UpdateMyUser/banner-picture?url=${myUserModel.storedDataUrls.bannerPictureUrl}`; - this.user.value.storedDataUrls.bannerPictureUrl = await client.post(updateBannerPictureEndpoint, bannerPicture, { - headers: { - 'Content-Type': 'application/octet-stream', - } - }); - - console.log(websiteIcon); - const updateWebsiteIconEndpoint = websiteIcon !== null && websiteIcon.size !== 0 ? `/api/UpdateMyUser/website-icon` : `/api/UpdateMyUser/website-icon?url=${myUserModel.storedDataUrls.websiteIconUrl}`; - this.user.value.storedDataUrls.websiteIconUrl = await client.post(updateWebsiteIconEndpoint, websiteIcon, { - headers: { - 'Content-Type': 'application/octet-stream', - } - }); + if (typeof myUserModel.storedDataUrls.profilePictureUrl !== "object") { + const updateProfilePictureEndpoint = profilePicture !== null && profilePicture.size !== 0 ? `/api/UpdateMyUser/profile-picture` : `/api/UpdateMyUser/profile-picture?url=${myUserModel.storedDataUrls.profilePictureUrl}`; + this.user.value.storedDataUrls.profilePictureUrl = await client.post(updateProfilePictureEndpoint, profilePicture, { + headers: { + 'Content-Type': 'application/octet-stream', + } + }); + } + if (typeof myUserModel.storedDataUrls.bannerPictureUrl !== "object") { + const updateBannerPictureEndpoint = bannerPicture !== null && bannerPicture.size !== 0 ? `/api/UpdateMyUser/banner-picture` : `/api/UpdateMyUser/banner-picture?url=${myUserModel.storedDataUrls.bannerPictureUrl}`; + this.user.value.storedDataUrls.bannerPictureUrl = await client.post(updateBannerPictureEndpoint, bannerPicture, { + headers: { + 'Content-Type': 'application/octet-stream', + } + }); + } + if (typeof myUserModel.storedDataUrls.websiteIconUrl !== "object") { + const updateWebsiteIconEndpoint = websiteIcon !== null && websiteIcon.size !== 0 ? `/api/UpdateMyUser/website-icon` : `/api/UpdateMyUser/website-icon?url=${myUserModel.storedDataUrls.websiteIconUrl}`; + this.user.value.storedDataUrls.websiteIconUrl = await client.post(updateWebsiteIconEndpoint, websiteIcon, { + headers: { + 'Content-Type': 'application/octet-stream', + } + }); + } } return { user, getCurrentUser, setCurrentUser, updateCurrentUser } diff --git a/src/views/main/Creator.vue b/src/views/main/Creator.vue index 38e804a..1134269 100644 --- a/src/views/main/Creator.vue +++ b/src/views/main/Creator.vue @@ -20,8 +20,9 @@ - - + + +
{ const response = await client.get(`/api/Users?UserName=${route.params.creator}`) user.value = response.data - console.log(response.data); }) diff --git a/src/views/main/CreatorBanner.vue b/src/views/main/CreatorBanner.vue index 9ad5749..f050f6d 100644 --- a/src/views/main/CreatorBanner.vue +++ b/src/views/main/CreatorBanner.vue @@ -3,7 +3,7 @@
-
+
1000+ Abonnés
500 Contacts en commun
@@ -30,9 +30,15 @@
-
{{ user.firstName}}
-
{{ user.lastName }}
-
{{ user.occupation }}
+
+

{{ user.firstName }}

+
+
+

{{ user.lastName }}

+
+
+

{{ user.occupation }}

+
@@ -40,13 +46,14 @@
-
+
Profile Picture + :style="{ borderColor: user.profileColors.accent, maxWidth: '250px', width: '100%' }" + >