-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add metadata content in lender profile for badge share #5610
base: main
Are you sure you want to change the base?
Conversation
}, | ||
const utmCampaign = currentRoute?.query?.utm_campaign ?? ''; | ||
const loadBadgeInfo = utmCampaign.includes('badge_') && utmCampaign.includes('social_share'); | ||
const badgeKey = utmCampaign.split('badge_')[1]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we be checking if badgeKey
is defined and acting different below if it's not defined?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mmm yeah, probably should be good to see if the badgeKey exist in contentful. I think I saw a list of badge keys that I can add here as an extra validation
}, | ||
completedAchievements() { | ||
return this.allAchievements.filter(achievement => achievement.status === 'COMPLETE'); | ||
}, | ||
}, | ||
methods: { | ||
loadBadgeInfo(badgeKey) { | ||
const data = this.apollo.readQuery({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We'll want a try catch around this, with logReadQueryError
in the catch
const utmCampaign = this.$route?.query?.utm_campaign ?? ''; | ||
if (utmCampaign.includes('badge_') && utmCampaign.includes('social_share')) { | ||
const badgeKey = utmCampaign.split('badge_')[1]; | ||
this.loadBadgeInfo(badgeKey); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need await
this query so that the data is guaranteed to be there on server render? I see that we're pulling data from this query to add to the page title and whatnot.
@christian14b @emuvente I see in the ticket that this is also needed on the home page, but with the home page being cached, I don't see a great way to update the page title and whatnot on server render. Maybe we can chat with product about using a different, non-cached page? |
@dyersituations Fastly treats URLs with different query parameters as separate cache objects unless we explicitly tell it not to https://docs.fastly.com/en/guides/making-query-strings-agnostic. So each different utm_campaign value will have a separate cached page. |
Ah yup, that's right, I forgot about the query params existing, thanks! |
Share metadata for badge share