Files
oldvine_cms/scripts/updateHeroContent.js
Talal Sharabi a3308a26e2 Initial commit: CMS backend for Old Vine Hotel
- Complete Express.js API server
- MongoDB integration with Mongoose
- Admin authentication and authorization
- Room management (CRUD operations)
- Booking management system
- Guest management
- Payment processing (Stripe integration)
- Content management (pages, blog, gallery)
- Media upload and management
- Integration services (Booking.com, Expedia, Opera PMS, Trip.com)
- Email notifications
- Comprehensive logging and error handling
2026-01-06 12:21:56 +04:00

47 lines
2.0 KiB
JavaScript

require('dotenv').config({ path: require('path').join(__dirname, '../.env') });
const mongoose = require('mongoose');
const Content = require('../models/Content');
const updateHeroContent = async () => {
try {
// Connect to MongoDB
await mongoose.connect(process.env.MONGODB_URI || 'mongodb://localhost:27017/vine_hotel');
console.log('✅ Connected to MongoDB');
// Find and update homepage content
const homepage = await Content.findOne({ page: 'home' });
if (!homepage) {
console.error('❌ Homepage content not found');
process.exit(1);
}
// Update hero section
homepage.hero = {
title: 'Your Home Away From Home',
subtitle: 'Experience Damascus Like Never Before',
description: `Hidden within the winding alleys of the ancient city of Old Damascus, Old Vine Hotel is a 5-star boutique haven that captures the essence of Syria's timeless charm. Once three historic damascene homes, the properties have been lovingly restored and seamlessly connected to create an intimate sanctuary of 25 beautifully designed rooms and suites.
Each corner whispers stories of the past, where handcrafted wood, marble courtyards, and elegant fountains blend effortlessly with modern comfort and sophistication. from the moment you step inside, you are embraced by an atmosphere of serenity, authenticity, and understated luxury—a true reflection of Damascus at its beauty.`,
backgroundImage: '/images/hero.jpg',
ctaText: 'Explore Rooms',
ctaLink: '/rooms'
};
await homepage.save();
console.log('✅ Hero content updated successfully!');
console.log('\n📝 New content:');
console.log('Title:', homepage.hero.title);
console.log('Subtitle:', homepage.hero.subtitle);
console.log('Description:', homepage.hero.description.substring(0, 100) + '...');
process.exit(0);
} catch (error) {
console.error('❌ Error updating hero content:', error);
process.exit(1);
}
};
updateHeroContent();