fix direction

This commit is contained in:
mmacierzanka committed 2023-05-26 21:24:19 +01:00
1 parent 1e101a67d6
commit 0f8bc2add1
1 file changed
+3 -3
+3 -3
View File
@@ -33,11 +33,11 @@ export class IssuesController {
}
@Get()
findAll(@Param('direction') direction: string) {
findAll(@Param('direction') direction?: string) {
return this.issuesService
.findAll(
direction.toLowerCase() === 'desc' ||
direction.toLowerCase() === 'descending',
direction?.toLowerCase() === 'desc' ||
direction?.toLowerCase() === 'descending',
)
.then((r) => r.map((i) => i.toDto()));
}