mirror of
https://github.com/IT4Change/gradido.git
synced 2026-02-06 09:56:05 +00:00
fix default value
This commit is contained in:
parent
3ecd108660
commit
cac7f5865a
@ -10,9 +10,9 @@ export class Paginated {
|
||||
@IsPositive()
|
||||
currentPage: number
|
||||
|
||||
@Field(() => Int, { defaultValue: 3 })
|
||||
@Field(() => Int, { nullable: true })
|
||||
@IsPositive()
|
||||
pageSize: number
|
||||
pageSize?: number
|
||||
|
||||
@Field(() => Order, { defaultValue: Order.DESC })
|
||||
@IsEnum(Order)
|
||||
|
||||
@ -28,7 +28,7 @@ function joinRelationsRecursive(
|
||||
}
|
||||
|
||||
export const findContributions = async (
|
||||
paginate: Paginated,
|
||||
{ pageSize = 3, currentPage, order }: Paginated,
|
||||
filter: SearchContributionsFilterArgs,
|
||||
withDeleted = false,
|
||||
relations: Relations | undefined = undefined,
|
||||
@ -61,9 +61,9 @@ export const findContributions = async (
|
||||
)
|
||||
}
|
||||
return queryBuilder
|
||||
.orderBy('Contribution.createdAt', paginate.order)
|
||||
.addOrderBy('Contribution.id', paginate.order)
|
||||
.skip((paginate.currentPage - 1) * paginate.pageSize)
|
||||
.take(paginate.pageSize)
|
||||
.orderBy('Contribution.createdAt', order)
|
||||
.addOrderBy('Contribution.id', order)
|
||||
.skip((currentPage - 1) * pageSize)
|
||||
.take(pageSize)
|
||||
.getManyAndCount()
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user