From e5fbbbf761d1792a635023dc74ed532baaca1a71 Mon Sep 17 00:00:00 2001 From: paha_koha Date: Sun, 22 Oct 2023 14:46:35 +0300 Subject: [PATCH] Fixed code style --- src/domain/service/userListService.ts | 4 ++-- src/presentation/http/router/userList.ts | 2 +- src/repository/storage/postgres/orm/sequelize/user.ts | 3 +-- src/repository/userList.repository.ts | 4 ++-- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/domain/service/userListService.ts b/src/domain/service/userListService.ts index 9bbc592c..b2dde1d2 100644 --- a/src/domain/service/userListService.ts +++ b/src/domain/service/userListService.ts @@ -21,9 +21,9 @@ export default class UserListService { * * @returns { Promise } user */ - public async getAllUsers(): Promise { + public async getUserList(): Promise { return { - users: await this.repository.getAllUsers(), + users: await this.repository.getUserList(), }; } } \ No newline at end of file diff --git a/src/presentation/http/router/userList.ts b/src/presentation/http/router/userList.ts index 1a0361b1..ce51a633 100644 --- a/src/presentation/http/router/userList.ts +++ b/src/presentation/http/router/userList.ts @@ -22,7 +22,7 @@ const AllUsersRouter: FastifyPluginCallback = (fastify, opts fastify.get('/allUsers', { }, async (_, reply) => { - const userList = await usersService.getAllUsers(); + const userList = await usersService.getUserList(); return reply.send(userList); }); diff --git a/src/repository/storage/postgres/orm/sequelize/user.ts b/src/repository/storage/postgres/orm/sequelize/user.ts index 34c77983..dd447c6c 100644 --- a/src/repository/storage/postgres/orm/sequelize/user.ts +++ b/src/repository/storage/postgres/orm/sequelize/user.ts @@ -4,7 +4,6 @@ import { Model, DataTypes } from 'sequelize'; import type Orm from '@repository/storage/postgres/orm/sequelize/index.js'; import type User from '@domain/entities/user.js'; import type { UserEditorTool } from '@domain/entities/userExtensions.js'; -import { UserList } from '@domain/entities/userList'; /** * Query options for getting user @@ -288,7 +287,7 @@ export default class UserSequelizeStorage { * Get list users * @returns { Promise } - found all users */ - public async getAllUsers(): Promise { + public async getUserList(): Promise { const userList = await this.model.findAll({ }); return userList; diff --git a/src/repository/userList.repository.ts b/src/repository/userList.repository.ts index 90645ca1..9066449d 100644 --- a/src/repository/userList.repository.ts +++ b/src/repository/userList.repository.ts @@ -21,7 +21,7 @@ export default class UserListRepository { * * @returns { Promise } user */ - public async getAllUsers(): Promise { - return await this.storage.getAllUsers(); + public async getUserList(): Promise { + return await this.storage.getUserList(); } } \ No newline at end of file