File tree Expand file tree Collapse file tree 3 files changed +6
-6
lines changed Expand file tree Collapse file tree 3 files changed +6
-6
lines changed Original file line number Diff line number Diff line change 11import { Request , Response } from "express" ;
2- import { getEntityManager } from "typeorm" ;
2+ import { getManager } from "typeorm" ;
33import { Post } from "../entity/Post" ;
44
55/**
@@ -8,7 +8,7 @@ import {Post} from "../entity/Post";
88export async function postGetAllAction ( request : Request , response : Response ) {
99
1010 // get a post repository to perform operations with post
11- const postRepository = getEntityManager ( ) . getRepository ( Post ) ;
11+ const postRepository = getManager ( ) . getRepository ( Post ) ;
1212
1313 // load a post by a given post id
1414 const posts = await postRepository . find ( ) ;
Original file line number Diff line number Diff line change 11import { Request , Response } from "express" ;
2- import { getEntityManager } from "typeorm" ;
2+ import { getManager } from "typeorm" ;
33import { Post } from "../entity/Post" ;
44
55/**
@@ -8,7 +8,7 @@ import {Post} from "../entity/Post";
88export async function postGetByIdAction ( request : Request , response : Response ) {
99
1010 // get a post repository to perform operations with post
11- const postRepository = getEntityManager ( ) . getRepository ( Post ) ;
11+ const postRepository = getManager ( ) . getRepository ( Post ) ;
1212
1313 // load a post by a given post id
1414 const post = await postRepository . findOneById ( request . params . id ) ;
Original file line number Diff line number Diff line change 11import { Request , Response } from "express" ;
2- import { getEntityManager } from "typeorm" ;
2+ import { getManager } from "typeorm" ;
33import { Post } from "../entity/Post" ;
44
55/**
@@ -8,7 +8,7 @@ import {Post} from "../entity/Post";
88export async function postSaveAction ( request : Request , response : Response ) {
99
1010 // get a post repository to perform operations with post
11- const postRepository = getEntityManager ( ) . getRepository ( Post ) ;
11+ const postRepository = getManager ( ) . getRepository ( Post ) ;
1212
1313 // create a real post object from post json object sent over http
1414 const newPost = postRepository . create ( request . body ) ;
You can’t perform that action at this time.
0 commit comments