From 5d9f06c2a57f0d48624f106620e60f8edcc01f87 Mon Sep 17 00:00:00 2001 From: muntaxir4 Date: Sun, 28 Jul 2024 18:13:31 +0530 Subject: [PATCH] Remove explicit number conversions --- apps/api/src/workspace/service/workspace.service.ts | 6 +++--- apps/api/src/workspace/workspace.e2e.spec.ts | 3 +++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/apps/api/src/workspace/service/workspace.service.ts b/apps/api/src/workspace/service/workspace.service.ts index f93a3648..38753e38 100644 --- a/apps/api/src/workspace/service/workspace.service.ts +++ b/apps/api/src/workspace/service/workspace.service.ts @@ -468,7 +468,7 @@ export class WorkspaceService { //get all members of workspace for page with limit const items = await this.prisma.workspaceMember.findMany({ skip: page * limit, - take: Number(limit), + take: limit, orderBy: { workspace: { [sort]: order @@ -538,8 +538,8 @@ export class WorkspaceService { }) const metadata = paginate(totalCount, `/workspace/${workspaceId}/members`, { - page: Number(page), - limit: Number(limit), + page, + limit, sort, order, search diff --git a/apps/api/src/workspace/workspace.e2e.spec.ts b/apps/api/src/workspace/workspace.e2e.spec.ts index 5a1c1e44..44d3e881 100644 --- a/apps/api/src/workspace/workspace.e2e.spec.ts +++ b/apps/api/src/workspace/workspace.e2e.spec.ts @@ -24,6 +24,7 @@ import { EventModule } from '../event/event.module' import { UserModule } from '../user/user.module' import { UserService } from '../user/service/user.service' import { WorkspaceService } from './service/workspace.service' +import { QueryTransformPipe } from '../common/query.transform.pipe' const createMembership = async ( adminRoleId: string, @@ -75,6 +76,8 @@ describe('Workspace Controller Tests', () => { userService = moduleRef.get(UserService) workspaceService = moduleRef.get(WorkspaceService) + app.useGlobalPipes(new QueryTransformPipe()) + await app.init() await app.getHttpAdapter().getInstance().ready() })