Остання активність 1729144992

TypeORM-readme-22.ts Неформатований
1import { Photo } from "./entity/Photo"
2import { AppDataSource } from "./index"
3
4const photo = new Photo()
5photo.name = "Me and Bears"
6photo.description = "I am near polar bears"
7photo.filename = "photo-with-bears.jpg"
8photo.views = 1
9photo.isPublished = true
10
11await AppDataSource.manager.save(photo)
12console.log("Photo has been saved. Photo id is", photo.id)