|
@@ -212,11 +212,10 @@ async function uploadImage(
|
|
|
async function seed() {
|
|
async function seed() {
|
|
|
console.log('🌱 Starting seed process...\n')
|
|
console.log('🌱 Starting seed process...\n')
|
|
|
|
|
|
|
|
- // Initialize Payload
|
|
|
|
|
- const payloadConfig = await config
|
|
|
|
|
- const payload = await getPayload({ config: payloadConfig })
|
|
|
|
|
-
|
|
|
|
|
try {
|
|
try {
|
|
|
|
|
+ const payloadConfig = await config
|
|
|
|
|
+ const payload = await getPayload({ config: payloadConfig })
|
|
|
|
|
+
|
|
|
// Reset collections (optional - uncomment if you want to clear existing data)
|
|
// Reset collections (optional - uncomment if you want to clear existing data)
|
|
|
console.log('🗑️ Clearing existing data...')
|
|
console.log('🗑️ Clearing existing data...')
|
|
|
try {
|
|
try {
|
|
@@ -344,14 +343,16 @@ async function seed() {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
console.log('✨ Seed process completed successfully!')
|
|
console.log('✨ Seed process completed successfully!')
|
|
|
|
|
+ process.exit(0)
|
|
|
} catch (error) {
|
|
} catch (error) {
|
|
|
console.error('❌ Seed process failed:', error)
|
|
console.error('❌ Seed process failed:', error)
|
|
|
process.exit(1)
|
|
process.exit(1)
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
- process.exit(0)
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// Run seed
|
|
// Run seed
|
|
|
-seed()
|
|
|
|
|
|
|
+seed().catch((error) => {
|
|
|
|
|
+ console.error('❌ Seed process failed:', error)
|
|
|
|
|
+ process.exit(1)
|
|
|
|
|
+})
|
|
|
|
|
|