feat: update testimonials content and implement automatic CMS record updates during seeding
This commit is contained in:
@@ -1490,42 +1490,42 @@ async function main() {
|
|||||||
pageSlug: 'landing',
|
pageSlug: 'landing',
|
||||||
sectionKey: 'testimonials',
|
sectionKey: 'testimonials',
|
||||||
content: {
|
content: {
|
||||||
title: "Our Clients' Trust Is Our Foundation",
|
title: 'Consumer Protection is Our Foundation',
|
||||||
subtitle: 'We help buyers, sellers, and investors close successful real estate deals with confidence in every transaction.',
|
subtitle: "Buying or selling your home is one of the largest decisions you will make in your life. Don't let yourself be chased by salesmen. Find the service provider that matches your unique needs.",
|
||||||
ratingInfo: 'Clients rate our real estate services 4.9 out of 5 on average, based on recent client reviews.',
|
ratingInfo: 'Clients rate our real estate services 4.9 out of 5 on average, based on recent client reviews.',
|
||||||
stats: [
|
stats: [
|
||||||
{
|
{
|
||||||
iconPath: '/assets/icons/cities-icon.svg',
|
iconPath: '/assets/icons/cities-icon.svg',
|
||||||
boldText: '25+ Cities &',
|
boldText: '3 states',
|
||||||
normalText: 'neighborhoods served',
|
normalText: 'and counting',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
iconPath: '/assets/icons/properties-icon.svg',
|
iconPath: '/assets/icons/properties-icon.svg',
|
||||||
boldText: '1,000+ Properties',
|
boldText: 'Hundreds of',
|
||||||
normalText: 'bought and sold for our clients.',
|
normalText: 'Professionals',
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
testimonials: [
|
testimonials: [
|
||||||
{
|
{
|
||||||
rating: 5,
|
rating: 5,
|
||||||
title: 'I have been working with Lorem ..',
|
title: 'No Longer Blood in the Water',
|
||||||
content: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean commodo ligula eget dolor. Sed dignissim, nisl eget tincidunt vulputate, lacus justo bibendum ipsum, vitae tempus risus lorem at nunc. Integer sed arcu vitae risus feugiat vehicula. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.',
|
content: 'Using other sites to find a realtor ended with my phone ringing constantly. My number was sold off to multiple lists and it was so overwhelming. RE-Quest gave me confidence that my information was protected and I decided who I was in contact with.',
|
||||||
author: 'Conor Kenney',
|
author: 'Alice T.',
|
||||||
role: 'Chief Operations Officer',
|
role: '',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
rating: 5,
|
rating: 5,
|
||||||
title: 'I have been working with Lorem ..',
|
title: 'Finding Someone Who Worked with Me',
|
||||||
content: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean commodo ligula eget dolor. Sed dignissim, nisl eget tincidunt vulputate, lacus justo bibendum ipsum, vitae tempus risus lorem at nunc. Integer sed arcu vitae risus feugiat vehicula. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.',
|
content: 'RE-Quest let me narrow down my search terms, so I knew before I called that they had experience with the loan program I needed. I loved the in-app chat feature to talk to my short list before committing to a phone call.',
|
||||||
author: 'Conor Kenney',
|
author: 'Kevin R.',
|
||||||
role: 'Chief Operations Officer',
|
role: '',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
rating: 5,
|
rating: 5,
|
||||||
title: 'I have been working with Lorem ..',
|
title: '',
|
||||||
content: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean commodo ligula eget dolor. Sed dignissim, nisl eget tincidunt vulputate, lacus justo bibendum ipsum, vitae tempus risus lorem at nunc. Integer sed arcu vitae risus feugiat vehicula. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.',
|
content: 'The search terms on RE-Quest allowed me to show off my expertise as an agent. Now when leads reach out to me, they already have an idea of what kind of agent I am. Instant connection!',
|
||||||
author: 'Conor Kenney',
|
author: 'Riley S.',
|
||||||
role: 'Chief Operations Officer',
|
role: '',
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
@@ -1569,7 +1569,19 @@ async function main() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
if (existing) {
|
if (existing) {
|
||||||
console.log(` ⚠️ CMS content "${cms.pageSlug}/${cms.sectionKey}" already exists`);
|
await prisma.cmsContent.update({
|
||||||
|
where: {
|
||||||
|
pageSlug_sectionKey: {
|
||||||
|
pageSlug: cms.pageSlug,
|
||||||
|
sectionKey: cms.sectionKey,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
data: {
|
||||||
|
content: cms.content,
|
||||||
|
isPublished: true,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
console.log(` 🔄 Updated CMS content: ${cms.pageSlug}/${cms.sectionKey}`);
|
||||||
} else {
|
} else {
|
||||||
await prisma.cmsContent.create({
|
await prisma.cmsContent.create({
|
||||||
data: {
|
data: {
|
||||||
|
|||||||
84
prisma/update-testimonials.ts
Normal file
84
prisma/update-testimonials.ts
Normal file
@@ -0,0 +1,84 @@
|
|||||||
|
import { PrismaClient } from '@prisma/client';
|
||||||
|
|
||||||
|
const prisma = new PrismaClient();
|
||||||
|
|
||||||
|
const testimonialsContent = {
|
||||||
|
title: 'Consumer Protection is Our Foundation',
|
||||||
|
subtitle:
|
||||||
|
"Buying or selling your home is one of the largest decisions you will make in your life. Don't let yourself be chased by salesmen. Find the service provider that matches your unique needs.",
|
||||||
|
ratingInfo:
|
||||||
|
'Clients rate our real estate services 4.9 out of 5 on average, based on recent client reviews.',
|
||||||
|
stats: [
|
||||||
|
{
|
||||||
|
iconPath: '/assets/icons/cities-icon.svg',
|
||||||
|
boldText: '3 states',
|
||||||
|
normalText: 'and counting',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
iconPath: '/assets/icons/properties-icon.svg',
|
||||||
|
boldText: 'Hundreds of',
|
||||||
|
normalText: 'Professionals',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
testimonials: [
|
||||||
|
{
|
||||||
|
rating: 5,
|
||||||
|
title: 'No Longer Blood in the Water',
|
||||||
|
content:
|
||||||
|
'Using other sites to find a realtor ended with my phone ringing constantly. My number was sold off to multiple lists and it was so overwhelming. RE-Quest gave me confidence that my information was protected and I decided who I was in contact with.',
|
||||||
|
author: 'Alice T.',
|
||||||
|
role: '',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
rating: 5,
|
||||||
|
title: 'Finding Someone Who Worked with Me',
|
||||||
|
content:
|
||||||
|
'RE-Quest let me narrow down my search terms, so I knew before I called that they had experience with the loan program I needed. I loved the in-app chat feature to talk to my short list before committing to a phone call.',
|
||||||
|
author: 'Kevin R.',
|
||||||
|
role: '',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
rating: 5,
|
||||||
|
title: '',
|
||||||
|
content:
|
||||||
|
'The search terms on RE-Quest allowed me to show off my expertise as an agent. Now when leads reach out to me, they already have an idea of what kind of agent I am. Instant connection!',
|
||||||
|
author: 'Riley S.',
|
||||||
|
role: '',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
};
|
||||||
|
|
||||||
|
async function main() {
|
||||||
|
const result = await prisma.cmsContent.upsert({
|
||||||
|
where: {
|
||||||
|
pageSlug_sectionKey: {
|
||||||
|
pageSlug: 'landing',
|
||||||
|
sectionKey: 'testimonials',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
update: {
|
||||||
|
content: testimonialsContent,
|
||||||
|
isPublished: true,
|
||||||
|
},
|
||||||
|
create: {
|
||||||
|
pageSlug: 'landing',
|
||||||
|
sectionKey: 'testimonials',
|
||||||
|
content: testimonialsContent,
|
||||||
|
isPublished: true,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
console.log('✅ Testimonials CMS content updated');
|
||||||
|
console.log(` id: ${result.id}`);
|
||||||
|
console.log(` pageSlug: ${result.pageSlug}`);
|
||||||
|
console.log(` sectionKey: ${result.sectionKey}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
main()
|
||||||
|
.catch((e) => {
|
||||||
|
console.error('❌ Failed to update testimonials:', e);
|
||||||
|
process.exit(1);
|
||||||
|
})
|
||||||
|
.finally(async () => {
|
||||||
|
await prisma.$disconnect();
|
||||||
|
});
|
||||||
Reference in New Issue
Block a user