Update application features and add scripts (core changes)
This commit is contained in:
@@ -0,0 +1,48 @@
|
||||
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)
|
||||
Reference in New Issue
Block a user