Skip to content

Commit 7cca393

Browse files
committed
QueryParams args as optional
1 parent 452b12e commit 7cca393

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/infrastructure/QueryParams.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,16 @@ export class QueryParams {
5555
* id?: string;
5656
* }} configuration arguments
5757
*/
58-
constructor(args: {
58+
constructor(args?: {
5959
pageSize?: number,
6060
order?: Order,
6161
id?: string;
6262
}) {
63-
if (args.pageSize) this.setPageSize(args.pageSize)
64-
if (args.order) this.setOrder(Order[args.order])
65-
if (args.id) this.setId(args.id)
63+
if (args) {
64+
if (args.pageSize) this.setPageSize(args.pageSize)
65+
if (args.order) this.setOrder(Order[args.order])
66+
if (args.id) this.setId(args.id)
67+
}
6668
}
6769

6870
public setPageSize(pageSize: number): QueryParams {

0 commit comments

Comments
 (0)