From 56afbb378dac839c6ae9bcbe8979f347a34d84c7 Mon Sep 17 00:00:00 2001 From: nfpappas-oddball <165396779+nfpappas-oddball@users.noreply.github.com> Date: Wed, 18 Sep 2024 13:19:08 -0400 Subject: [PATCH] Fix: Issue 663 social links (#706) Co-authored-by: JR Reed --- src/data/queries/event.ts | 2 +- src/data/queries/newsStory.ts | 2 +- src/data/queries/newsStoryTeaser.ts | 2 +- src/data/queries/tests/__snapshots__/event.test.tsx.snap | 2 +- src/data/queries/tests/__snapshots__/newsStory.test.tsx.snap | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/data/queries/event.ts b/src/data/queries/event.ts index 6e571c5fe..ac87d29a3 100644 --- a/src/data/queries/event.ts +++ b/src/data/queries/event.ts @@ -52,7 +52,7 @@ export const formatter: QueryFormatter = ( date: entity.created, lastUpdated: entity.changed, socialLinks: { - path: entity.path.alias, + path: `${process.env.SITE_URL}${entity.path.alias}`, title: entity.title, }, listing: entity.field_listing.path.alias, diff --git a/src/data/queries/newsStory.ts b/src/data/queries/newsStory.ts index 1382cb3dd..24ae3c1ad 100644 --- a/src/data/queries/newsStory.ts +++ b/src/data/queries/newsStory.ts @@ -52,7 +52,7 @@ export const formatter: QueryFormatter = ( bodyContent: entity.field_full_story, date: entity.created, socialLinks: { - path: entity.path.alias, + path: `${process.env.SITE_URL}${entity.path.alias}`, title: entity.title, }, listing: entity.field_listing.path.alias, diff --git a/src/data/queries/newsStoryTeaser.ts b/src/data/queries/newsStoryTeaser.ts index 79f81d9cc..084256a3f 100644 --- a/src/data/queries/newsStoryTeaser.ts +++ b/src/data/queries/newsStoryTeaser.ts @@ -23,7 +23,7 @@ export const formatter: QueryFormatter = ( headingLevel: 'h2', //@todo fix headingLevel, title: entity.title, image: queries.formatData('media--image', entity.field_media), //cropType: '2_1_large' - link: entity.path.alias, + link: `${entity.path.alias}`, introText: entity.field_intro_text, lastUpdated: entity.field_last_saved_by_an_editor || entity.created, } diff --git a/src/data/queries/tests/__snapshots__/event.test.tsx.snap b/src/data/queries/tests/__snapshots__/event.test.tsx.snap index 1abc5f7f2..93323bdd0 100644 --- a/src/data/queries/tests/__snapshots__/event.test.tsx.snap +++ b/src/data/queries/tests/__snapshots__/event.test.tsx.snap @@ -91,7 +91,7 @@ exports[`node--event formatData outputs formatted data 1`] = ` "published": true, "registrationRequired": false, "socialLinks": { - "path": "/central-iowa-health-care/events/52265", + "path": "http://127.0.0.1:8001/central-iowa-health-care/events/52265", "title": "Pickleball Club", }, "title": "Pickleball Club", diff --git a/src/data/queries/tests/__snapshots__/newsStory.test.tsx.snap b/src/data/queries/tests/__snapshots__/newsStory.test.tsx.snap index 1478992ef..5f04decb8 100644 --- a/src/data/queries/tests/__snapshots__/newsStory.test.tsx.snap +++ b/src/data/queries/tests/__snapshots__/newsStory.test.tsx.snap @@ -467,7 +467,7 @@ exports[`node--news_story formatData outputs formatted data 1`] = ` "moderationState": "published", "published": true, "socialLinks": { - "path": "/pittsburgh-health-care/stories/we-honor-outstanding-doctors", + "path": "http://127.0.0.1:8001/pittsburgh-health-care/stories/we-honor-outstanding-doctors", "title": "We honor outstanding doctors", }, "title": "We honor outstanding doctors",