Allow creating transactions without a category
This commit is contained in:
parent
0fdbdc3c3c
commit
fc63684993
2 changed files with 1 additions and 4 deletions
|
@ -62,7 +62,7 @@ struct AddTransactionView: View {
|
|||
description: self.description,
|
||||
date: self.date,
|
||||
amount: Int(amount * 100.0),
|
||||
categoryId: self.categoryId,
|
||||
categoryId: self.categoryId != "" ? self.categoryId : nil,
|
||||
expense: self.type == TransactionType.expense,
|
||||
createdBy: self.createdBy,
|
||||
budgetId: self.budgetId
|
||||
|
|
|
@ -71,9 +71,6 @@ class TransactionDataStore: ObservableObject {
|
|||
|
||||
func saveTransaction(_ transaction: Transaction) {
|
||||
self.transaction = .failure(.loading)
|
||||
// if transaction.categoryId == "" {
|
||||
// transaction.categoryId = nil
|
||||
// }
|
||||
var transactionSavePublisher: AnyPublisher<Transaction, NetworkError>
|
||||
if (transaction.id != "") {
|
||||
transactionSavePublisher = self.transactionRepository.updateTransaction(transaction)
|
||||
|
|
Loading…
Reference in a new issue