Skip to content

Commit 592bbfe

Browse files
committed
Sort by return
1 parent 8a0ea48 commit 592bbfe

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Sources/Grodt/DTOs/DTOMappers/InvestmentDTOMapper.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,9 @@ class InvestmentDTOMapper {
5353
)
5454
}
5555

56-
return investments
56+
return investments.sorted { lft, rgh in
57+
lft.totalReturn > rgh.totalReturn
58+
}
5759
}
5860

5961
func investmentDetail(from transactions: [Transaction])async throws -> InvestmentDetailDTO {

0 commit comments

Comments
 (0)