Skip to content

Commit

Permalink
Merge pull request #31 from moneymanagerex/fix_compile_error
Browse files Browse the repository at this point in the history
fix compile errors in TransactionRepository
  • Loading branch information
georgeef authored Sep 24, 2024
2 parents dab1c1f + 60bfcd1 commit d1ddf76
Showing 1 changed file with 6 additions and 11 deletions.
17 changes: 6 additions & 11 deletions MMEX/Repositories/TransactionRepository.swift
Original file line number Diff line number Diff line change
Expand Up @@ -144,23 +144,18 @@ extension TransactionRepository {
startDate: Date? = Calendar.current.date(byAdding: .month, value: -3, to: Date()),
endDate: Date? = Date()
) -> [TransactionData] {
var table = Self.repositoryTable

var filter = Expression<Bool?>(value: true)

if let accountId {
table = table.filter(Self.col_accountId == accountId || Self.col_toAccountId == accountId)
}
if let startDate {
filter = filter && (Self.col_transDate >= startDate.ISO8601Format())
table = table.filter(Self.col_transDate >= startDate.ISO8601Format())
}

//if let endDate {
// filter = filter && (Self.col_transDate <= endDate.ISO8601Format())
// table = table.filter(Self.col_transDate <= endDate.ISO8601Format())
//}

if let accountId {
filter = filter && ((Self.col_accountId == accountId) || (Self.col_toAccountId == accountId))
}

let table = Self.repositoryTable.filter(filter)

return selectData(from: table)
}
}

0 comments on commit d1ddf76

Please sign in to comment.