Skip to content

Commit

Permalink
🌼 Update Version - v10.2.1 (#228)
Browse files Browse the repository at this point in the history
* πŸ›  Refactoring Code

- import pg modules

* 🐞 Fix Bug

- pg container, an error occurs that the environment key
- #218

* 🌼 Update Version - v10.1.1

* πŸ›  Refactoring Code

- Fix ValidationMiddleware Parameter

* 🌼 Update Version - v10.2.1
  • Loading branch information
ljlm0402 authored Oct 4, 2023
1 parent 02c853c commit a012cef
Show file tree
Hide file tree
Showing 16 changed files with 30 additions and 30 deletions.
4 changes: 2 additions & 2 deletions lib/mikro-orm/src/routes/auth.route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ export class AuthRoute implements Routes {
}

private initializeRoutes() {
this.router.post(`${this.path}signup`, ValidationMiddleware(CreateUserDto, 'body'), this.auth.signUp);
this.router.post(`${this.path}login`, ValidationMiddleware(CreateUserDto, 'body'), this.auth.logIn);
this.router.post(`${this.path}signup`, ValidationMiddleware(CreateUserDto), this.auth.signUp);
this.router.post(`${this.path}login`, ValidationMiddleware(CreateUserDto), this.auth.logIn);
this.router.post(`${this.path}logout`, AuthMiddleware, this.auth.logOut);
}
}
4 changes: 2 additions & 2 deletions lib/mikro-orm/src/routes/users.route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ export class UserRoute implements Routes {
private initializeRoutes() {
this.router.get(`${this.path}`, this.user.getUsers);
this.router.get(`${this.path}/:id`, this.user.getUserById);
this.router.post(`${this.path}`, ValidationMiddleware(CreateUserDto, 'body'), this.user.createUser);
this.router.put(`${this.path}/:id`, ValidationMiddleware(CreateUserDto, 'body', true), this.user.updateUser);
this.router.post(`${this.path}`, ValidationMiddleware(CreateUserDto), this.user.createUser);
this.router.put(`${this.path}/:id`, ValidationMiddleware(CreateUserDto, true), this.user.updateUser);
this.router.delete(`${this.path}/:id`, this.user.deleteUser);
}
}
4 changes: 2 additions & 2 deletions lib/mongoose/src/routes/auth.route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ export class AuthRoute implements Routes {
}

private initializeRoutes() {
this.router.post(`${this.path}signup`, ValidationMiddleware(CreateUserDto, 'body'), this.auth.signUp);
this.router.post(`${this.path}login`, ValidationMiddleware(CreateUserDto, 'body'), this.auth.logIn);
this.router.post(`${this.path}signup`, ValidationMiddleware(CreateUserDto), this.auth.signUp);
this.router.post(`${this.path}login`, ValidationMiddleware(CreateUserDto), this.auth.logIn);
this.router.post(`${this.path}logout`, AuthMiddleware, this.auth.logOut);
}
}
4 changes: 2 additions & 2 deletions lib/mongoose/src/routes/users.route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ export class UserRoute implements Routes {
private initializeRoutes() {
this.router.get(`${this.path}`, this.user.getUsers);
this.router.get(`${this.path}/:id`, this.user.getUserById);
this.router.post(`${this.path}`, ValidationMiddleware(CreateUserDto, 'body'), this.user.createUser);
this.router.put(`${this.path}/:id`, ValidationMiddleware(CreateUserDto, 'body', true), this.user.updateUser);
this.router.post(`${this.path}`, ValidationMiddleware(CreateUserDto), this.user.createUser);
this.router.put(`${this.path}/:id`, ValidationMiddleware(CreateUserDto, true), this.user.updateUser);
this.router.delete(`${this.path}/:id`, this.user.deleteUser);
}
}
4 changes: 2 additions & 2 deletions lib/prisma/src/routes/auth.route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ export class AuthRoute implements Routes {
}

private initializeRoutes() {
this.router.post(`${this.path}signup`, ValidationMiddleware(CreateUserDto, 'body'), this.auth.signUp);
this.router.post(`${this.path}login`, ValidationMiddleware(CreateUserDto, 'body'), this.auth.logIn);
this.router.post(`${this.path}signup`, ValidationMiddleware(CreateUserDto), this.auth.signUp);
this.router.post(`${this.path}login`, ValidationMiddleware(CreateUserDto), this.auth.logIn);
this.router.post(`${this.path}logout`, AuthMiddleware, this.auth.logOut);
}
}
4 changes: 2 additions & 2 deletions lib/prisma/src/routes/users.route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ export class UserRoute implements Routes {
private initializeRoutes() {
this.router.get(`${this.path}`, this.user.getUsers);
this.router.get(`${this.path}/:id(\\d+)`, this.user.getUserById);
this.router.post(`${this.path}`, ValidationMiddleware(CreateUserDto, 'body'), this.user.createUser);
this.router.put(`${this.path}/:id(\\d+)`, ValidationMiddleware(CreateUserDto, 'body', true), this.user.updateUser);
this.router.post(`${this.path}`, ValidationMiddleware(CreateUserDto), this.user.createUser);
this.router.put(`${this.path}/:id(\\d+)`, ValidationMiddleware(CreateUserDto, true), this.user.updateUser);
this.router.delete(`${this.path}/:id(\\d+)`, this.user.deleteUser);
}
}
2 changes: 1 addition & 1 deletion lib/routing-controllers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"build": "swc src -d dist --source-maps --copy-files",
"build:tsc": "tsc && tsc-alias",
"test": "jest --forceExit --detectOpenHandles",
"lint": "eslint --ignore-path .gitignore --ext .ts src/",
"lint": "eslint --ignore-path .gitignore --ext .ts src",
"lint:fix": "npm run lint -- --fix",
"deploy:prod": "npm run build && pm2 start ecosystem.config.js --only prod",
"deploy:dev": "pm2 start ecosystem.config.js --only dev"
Expand Down
4 changes: 2 additions & 2 deletions lib/routing-controllers/src/controllers/auth.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ export class AuthController {
public auth = Container.get(AuthService);

@Post('/signup')
@UseBefore(ValidationMiddleware(CreateUserDto, 'body'))
@UseBefore(ValidationMiddleware(CreateUserDto))
@HttpCode(201)
async signUp(@Body() userData: User) {
const signUpUserData: User = await this.auth.signup(userData);
return { data: signUpUserData, message: 'signup' };
}

@Post('/login')
@UseBefore(ValidationMiddleware(CreateUserDto, 'body'))
@UseBefore(ValidationMiddleware(CreateUserDto))
async logIn(@Res() res: Response, @Body() userData: User) {
const { cookie, findUser } = await this.auth.login(userData);

Expand Down
4 changes: 2 additions & 2 deletions lib/routing-controllers/src/controllers/users.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@ export class UserController {

@Post('/users')
@HttpCode(201)
@UseBefore(ValidationMiddleware(CreateUserDto, 'body'))
@UseBefore(ValidationMiddleware(CreateUserDto))
@OpenAPI({ summary: 'Create a new user' })
async createUser(@Body() userData: User) {
const createUserData: User = await this.user.createUser(userData);
return { data: createUserData, message: 'created' };
}

@Put('/users/:id')
@UseBefore(ValidationMiddleware(CreateUserDto, 'body', true))
@UseBefore(ValidationMiddleware(CreateUserDto, true))
@OpenAPI({ summary: 'Update a user' })
async updateUser(@Param('id') userId: number, @Body() userData: User) {
const updateUserData: User[] = await this.user.updateUser(userId, userData);
Expand Down
4 changes: 2 additions & 2 deletions lib/sequelize/src/routes/auth.route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ export class AuthRoute implements Routes {
}

private initializeRoutes() {
this.router.post('/signup', ValidationMiddleware(CreateUserDto, 'body'), this.auth.signUp);
this.router.post('/login', ValidationMiddleware(CreateUserDto, 'body'), this.auth.logIn);
this.router.post('/signup', ValidationMiddleware(CreateUserDto), this.auth.signUp);
this.router.post('/login', ValidationMiddleware(CreateUserDto), this.auth.logIn);
this.router.post('/logout', AuthMiddleware, this.auth.logOut);
}
}
4 changes: 2 additions & 2 deletions lib/sequelize/src/routes/users.route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ export class UserRoute implements Routes {
private initializeRoutes() {
this.router.get(`${this.path}`, this.user.getUsers);
this.router.get(`${this.path}/:id(\\d+)`, this.user.getUserById);
this.router.post(`${this.path}`, ValidationMiddleware(CreateUserDto, 'body'), this.user.createUser);
this.router.put(`${this.path}/:id(\\d+)`, ValidationMiddleware(CreateUserDto, 'body', true), this.user.updateUser);
this.router.post(`${this.path}`, ValidationMiddleware(CreateUserDto), this.user.createUser);
this.router.put(`${this.path}/:id(\\d+)`, ValidationMiddleware(CreateUserDto, true), this.user.updateUser);
this.router.delete(`${this.path}/:id(\\d+)`, this.user.deleteUser);
}
}
4 changes: 2 additions & 2 deletions lib/typegoose/src/routes/auth.route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ export class AuthRoute implements Routes {
}

private initializeRoutes() {
this.router.post('/signup', ValidationMiddleware(CreateUserDto, 'body'), this.auth.signUp);
this.router.post('/login', ValidationMiddleware(CreateUserDto, 'body'), this.auth.logIn);
this.router.post('/signup', ValidationMiddleware(CreateUserDto), this.auth.signUp);
this.router.post('/login', ValidationMiddleware(CreateUserDto), this.auth.logIn);
this.router.post('/logout', AuthMiddleware, this.auth.logOut);
}
}
4 changes: 2 additions & 2 deletions lib/typegoose/src/routes/users.route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ export class UserRoute implements Routes {
private initializeRoutes() {
this.router.get(`${this.path}`, this.user.getUsers);
this.router.get(`${this.path}/:id`, this.user.getUserById);
this.router.post(`${this.path}`, ValidationMiddleware(CreateUserDto, 'body'), this.user.createUser);
this.router.put(`${this.path}/:id`, ValidationMiddleware(CreateUserDto, 'body', true), this.user.updateUser);
this.router.post(`${this.path}`, ValidationMiddleware(CreateUserDto), this.user.createUser);
this.router.put(`${this.path}/:id`, ValidationMiddleware(CreateUserDto, true), this.user.updateUser);
this.router.delete(`${this.path}/:id`, this.user.deleteUser);
}
}
4 changes: 2 additions & 2 deletions lib/typeorm/src/routes/auth.route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ export class AuthRoute implements Routes {
}

private initializeRoutes() {
this.router.post('/signup', ValidationMiddleware(CreateUserDto, 'body'), this.auth.signUp);
this.router.post('/login', ValidationMiddleware(CreateUserDto, 'body'), this.auth.logIn);
this.router.post('/signup', ValidationMiddleware(CreateUserDto), this.auth.signUp);
this.router.post('/login', ValidationMiddleware(CreateUserDto), this.auth.logIn);
this.router.post('/logout', AuthMiddleware, this.auth.logOut);
}
}
4 changes: 2 additions & 2 deletions lib/typeorm/src/routes/users.route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ export class UserRoute implements Routes {
private initializeRoutes() {
this.router.get(`${this.path}`, this.user.getUsers);
this.router.get(`${this.path}/:id(\\d+)`, this.user.getUserById);
this.router.post(`${this.path}`, ValidationMiddleware(CreateUserDto, 'body'), this.user.createUser);
this.router.put(`${this.path}/:id(\\d+)`, ValidationMiddleware(CreateUserDto, 'body', true), this.user.updateUser);
this.router.post(`${this.path}`, ValidationMiddleware(CreateUserDto), this.user.createUser);
this.router.put(`${this.path}/:id(\\d+)`, ValidationMiddleware(CreateUserDto, true), this.user.updateUser);
this.router.delete(`${this.path}/:id(\\d+)`, this.user.deleteUser);
}
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "typescript-express-starter",
"version": "10.1.1",
"version": "10.2.1",
"description": "Quick and Easy TypeScript Express Starter",
"author": "AGUMON <[email protected]>",
"license": "MIT",
Expand Down

0 comments on commit a012cef

Please sign in to comment.