Skip to content

Commit

Permalink
import
Browse files Browse the repository at this point in the history
  • Loading branch information
CodeMaster482 committed Dec 28, 2023
1 parent 0cce87e commit 2b1932d
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions internal/microservices/IOhub/delivery/http/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -367,10 +367,14 @@ func (h *Handler) ImportTransactions(w http.ResponseWriter, r *http.Request) {
Description: description,
}

transaction.Categories = append(transaction.Categories, models.CategoryName{
ID: tagId,
Name: tagName,
})
if tagName != "" {
transaction.Categories = append(transaction.Categories, models.CategoryName{
ID: tagId,
Name: tagName,
})
} else {
transaction.Categories = nil
}

// Create the transaction in the database
_, err = h.transactionService.CreateTransaction(r.Context(), &transaction)
Expand Down

0 comments on commit 2b1932d

Please sign in to comment.