diff --git a/by-language/javascript-typeorm/src/controller/UserController.ts b/by-language/javascript-typeorm/src/controller/UserController.ts index 339a75b2..ab4d6199 100644 --- a/by-language/javascript-typeorm/src/controller/UserController.ts +++ b/by-language/javascript-typeorm/src/controller/UserController.ts @@ -11,7 +11,7 @@ export class UserController { } async one(request: Request, response: Response, next: NextFunction) { - const id = parseInt(request.params.id) + const id = request.params.id const user = await this.userRepository.findOne({ @@ -37,7 +37,7 @@ export class UserController { } async remove(request: Request, response: Response, next: NextFunction) { - const id = parseInt(request.params.id) + const id = request.params.id let userToRemove = await this.userRepository.findOneBy({ id }) @@ -50,4 +50,4 @@ export class UserController { return "user has been removed" } -} \ No newline at end of file +} diff --git a/by-language/javascript-typeorm/src/entity/User.ts b/by-language/javascript-typeorm/src/entity/User.ts index 37e9b414..4dbd1879 100644 --- a/by-language/javascript-typeorm/src/entity/User.ts +++ b/by-language/javascript-typeorm/src/entity/User.ts @@ -4,7 +4,7 @@ import { Entity, PrimaryGeneratedColumn, Column } from "typeorm" export class User { @PrimaryGeneratedColumn("uuid") - id: number + id: string @Column() firstName: string