Skip to content

Commit

Permalink
Remove explicit number conversions
Browse files Browse the repository at this point in the history
  • Loading branch information
muntaxir4 authored and rajdip-b committed Jul 29, 2024
1 parent 219af90 commit 6a4951d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
3 changes: 3 additions & 0 deletions apps/api/src/project/project.e2e.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ import { VariableService } from '../variable/service/variable.service'
import { VariableModule } from '../variable/variable.module'
import { SecretModule } from '../secret/secret.module'
import { EnvironmentModule } from '../environment/environment.module'
import { QueryTransformPipe } from '../common/query.transform.pipe'

describe('Project Controller Tests', () => {
let app: NestFastifyApplication
Expand Down Expand Up @@ -86,6 +87,8 @@ describe('Project Controller Tests', () => {
secretService = moduleRef.get(SecretService)
variableService = moduleRef.get(VariableService)

app.useGlobalPipes(new QueryTransformPipe())

await app.init()
await app.getHttpAdapter().getInstance().ready()
})
Expand Down
10 changes: 5 additions & 5 deletions apps/api/src/project/service/project.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -612,8 +612,8 @@ export class ProjectService {
forksAllowed.length,
`/project/${projectId}/forks`,
{
page: Number(page),
limit: Number(limit)
page,
limit
}
)

Expand Down Expand Up @@ -654,7 +654,7 @@ export class ProjectService {
const items = (
await this.prisma.project.findMany({
skip: page * limit,
take: Number(limit),
take: limit,
orderBy: {
[sort]: order
},
Expand Down Expand Up @@ -710,8 +710,8 @@ export class ProjectService {
})

const metadata = paginate(totalCount, `/project/all/${workspaceId}`, {
page: Number(page),
limit: Number(limit),
page,
limit,
sort,
order,
search
Expand Down

0 comments on commit 6a4951d

Please sign in to comment.