Skip to content

Commit 07ce222

Browse files
authored
Used site_uuid over site_url in Explore testimonials (#24478)
ref https://linear.app/ghost/issue/PROD-1771 - Explore testimonials API has been updated to accept a site uuid over a site url - The staff name/role fields have also been dropped
1 parent c5d5023 commit 07ce222

File tree

3 files changed

+14
-7
lines changed

3 files changed

+14
-7
lines changed

apps/admin-x-framework/src/api/site.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ export type SiteData = {
1313
url: string;
1414
locale: string;
1515
version: string;
16+
site_uuid: string;
1617
};
1718

1819
export interface SiteResponseType {

apps/admin-x-settings/src/components/settings/growth/explore/TestimonialsModal.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const TestimonialsModal = NiceModal.create(() => {
1919

2020
const exploreTestimonialsUrl = config.exploreTestimonialsUrl as string;
2121

22-
const siteUrl = siteData.url;
22+
const siteUuid = siteData.site_uuid;
2323
const [siteTitle] = getSettingValues<string>(settings, ['title']);
2424
const staffUserName = currentUser.name;
2525
const staffUserEmail = currentUser.email;
@@ -33,10 +33,8 @@ const TestimonialsModal = NiceModal.create(() => {
3333
},
3434
onSave: async (): Promise<void> => {
3535
const payload = {
36-
site_url: siteUrl,
37-
staff_user_name: staffUserName,
36+
ghost_uuid: siteUuid,
3837
staff_user_email: staffUserEmail,
39-
staff_user_role: staffUserRole,
4038
content: formState.content,
4139
prev_platform: formState.prev_platform
4240
};

apps/admin-x-settings/test/acceptance/growth/explore.test.ts

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,16 @@ test.describe('Ghost Explore', () => {
114114
{key: 'explore_ping_growth', value: true}
115115
]
116116
}
117+
},
118+
browseSite: {
119+
...globalDataRequests.browseSite,
120+
response: {
121+
...responseFixtures.site,
122+
site: {
123+
...responseFixtures.site.site,
124+
site_uuid: '9a604cf9-4c27-4a05-9991-be9974a764c5'
125+
}
126+
}
117127
}
118128
}});
119129

@@ -167,10 +177,8 @@ test.describe('Ghost Explore', () => {
167177

168178
// Verify the API request was made with correct payload
169179
expect(testimonialRequestBody).toEqual({
170-
site_url: 'http://test.com/',
171-
staff_user_name: 'Owner User',
180+
ghost_uuid: '9a604cf9-4c27-4a05-9991-be9974a764c5',
172181
staff_user_email: '[email protected]',
173-
staff_user_role: 'Owner',
174182
content: 'I love Ghost!',
175183
prev_platform: 'wordpress'
176184
});

0 commit comments

Comments
 (0)