Files

49 lines
1.0 KiB
TypeScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import { config } from 'dotenv'
config()
import fs from 'fs'
import path from 'path'
async function getPrisma() {
const { db } = await import('./lib/db')
return db
}
async function main() {
const prisma = await getPrisma()
console.log('Süit Daire 1 aranıyor...')
const suiteRoom = await prisma.room.findFirst({
where: { nameTr: { contains: 'Süit Daire 1' } }
})
if (!suiteRoom) {
console.error('Süit Daire 1 bulunamadı!')
return
}
console.log('Standart Oda 1 (25m²) aranıyor...')
const standardRoom = await prisma.room.findFirst({
where: { nameTr: { contains: 'Standart Oda 1' } }
})
if (!standardRoom) {
console.error('Standart Oda 1 bulunamadı!')
return
}
console.log('Resimler kopyalanıyor...')
await prisma.room.update({
where: { id: standardRoom.id },
data: {
imageUrl: suiteRoom.imageUrl,
images: suiteRoom.images
}
})
console.log('Standart Oda 1 resimleri başarıyla güncellendi!')
await prisma.$disconnect()
}
main().catch(console.error)