diff --git a/package.json b/package.json index 5f5682e..473c808 100644 --- a/package.json +++ b/package.json @@ -9,9 +9,6 @@ "ionic:build": "ionic-app-scripts build", "ionic:serve": "ionic-app-scripts serve" }, - "config": { - "ionic_webpack": "./config/webpack.config.js" - }, "dependencies": { "@angular/common": "4.4.3", "@angular/compiler": "4.4.3", @@ -37,7 +34,7 @@ "ionicons": "3.0.0", "rxjs": "5.4.3", "sw-toolbox": "3.6.0", - "typeorm": "0.1.0", + "typeorm": "0.1.5", "zone.js": "0.8.17" }, "devDependencies": { diff --git a/src/entities/author.ts b/src/entities/author.ts index 3c7be27..23be3a8 100644 --- a/src/entities/author.ts +++ b/src/entities/author.ts @@ -1,5 +1,4 @@ -import {Entity, Column, PrimaryGeneratedColumn, OneToMany} from "typeorm"; -import {Post} from "./post"; +import {Entity, Column, PrimaryGeneratedColumn} from "typeorm"; @Entity('author') export class Author { @@ -12,7 +11,4 @@ export class Author { @Column({nullable: true}) birthdate: string; - - @OneToMany(type => Post, post => post.author) - posts: Post[]; } diff --git a/src/entities/post.ts b/src/entities/post.ts index fa76259..7e7874c 100644 --- a/src/entities/post.ts +++ b/src/entities/post.ts @@ -20,7 +20,7 @@ export class Post { @JoinTable() categories: Category[]; - @ManyToOne(type => Author, author => author.posts, { + @ManyToOne(type => Author, { cascadeInsert: true }) author: Author; diff --git a/tsconfig.json b/tsconfig.json index e70db4d..af4d056 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -11,7 +11,7 @@ "module": "es2015", "moduleResolution": "node", "sourceMap": true, - "target": "es5", + "target": "es6", "typeRoots": [ "node_modules/@types" ]