Skip to content

Commit 68e7937

Browse files
author
Umed Khudoiberdiev
committed
updated typeorm version to 0.2.0
1 parent 730fc03 commit 68e7937

File tree

3 files changed

+9
-10
lines changed

3 files changed

+9
-10
lines changed

package.json

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,16 @@
2424
"typeorm-express-example"
2525
],
2626
"devDependencies": {
27-
"typescript": "^2.5.3"
27+
"@types/body-parser": "^1.16.8",
28+
"@types/express": "^4.11.1",
29+
"@types/node": "^9.6.5",
30+
"typescript": "^2.8.1"
2831
},
2932
"dependencies": {
30-
"@types/body-parser": "^1.16.5",
31-
"@types/express": "^4.0.37",
32-
"@types/node": "^8.0.31",
3333
"body-parser": "^1.18.2",
34-
"express": "^4.15.5",
35-
"mysql": "^2.14.1",
36-
"reflect-metadata": "^0.1.10",
37-
"typeorm": "^0.1.0"
34+
"express": "^4.16.3",
35+
"mysql": "^2.15.0",
36+
"typeorm": "^0.2.0"
3837
},
3938
"scripts": {
4039
"start": "tsc && node src/index.js"

src/controller/PostGetByIdAction.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export async function postGetByIdAction(request: Request, response: Response) {
1111
const postRepository = getManager().getRepository(Post);
1212

1313
// load a post by a given post id
14-
const post = await postRepository.findOneById(request.params.id);
14+
const post = await postRepository.findOne(request.params.id);
1515

1616
// if post was not found return 404 to the client
1717
if (!post) {

src/entity/Post.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export class Post {
1414
text: string;
1515

1616
@ManyToMany(type => Category, {
17-
cascadeInsert: true
17+
cascade: true
1818
})
1919
@JoinTable()
2020
categories: Category[];

0 commit comments

Comments
 (0)