Skip to content

Commit

Permalink
fix campaign seo data
Browse files Browse the repository at this point in the history
  • Loading branch information
imhson committed Jun 25, 2024
1 parent 7b103a1 commit f3a9f2a
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/pages/campaigns/[campaignSlug]/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,18 +39,18 @@ export const getServerSideProps = async (context) => {
const campaignLanguages =
campaign.campaign_i18n.find((ml) => ml.i18n_language.id == 1) ||
campaign.campaign_i18n.find((ml) => ml.i18n_language.is_main)
props.image = campaignLanguages?.data?.thumbnail_url
props.title = campaignLanguages?.data?.name
props.description = campaignLanguages?.data?.description

props.image = campaignLanguages?.data?.seo?.thumbnail_url || campaignLanguages?.data?.thumbnail_url
props.title = campaignLanguages?.data?.seo?.name || campaignLanguages?.data?.name
props.description = campaignLanguages?.data?.seo?.description || campaignLanguages?.data?.description
} else {
const campaignLanguages =
campaign.campaign_i18n.find((ml) => ml.i18n_language.id == 2) ||
campaign.campaign_i18n.find((ml) => ml.i18n_language.is_main)

props.image = campaignLanguages?.data?.thumbnail_url
props.title = campaignLanguages?.data?.name
props.description = campaignLanguages?.data?.description
props.image = campaignLanguages?.data?.seo?.thumbnail_url || campaignLanguages?.data?.thumbnail_url
props.title = campaignLanguages?.data?.seo?.name || campaignLanguages?.data?.name
props.description = campaignLanguages?.data?.seo?.description || campaignLanguages?.data?.description
}
return {
props: {
Expand Down

0 comments on commit f3a9f2a

Please sign in to comment.