allows adding
This commit is contained in:
@@ -45,4 +45,13 @@
|
||||
(Integer/parseInt id))))
|
||||
|
||||
|
||||
(defn add-bank-account [id bank-account]
|
||||
(let [company (get-by-id id)
|
||||
company (update company :bank-accounts
|
||||
(fn [ba]
|
||||
(let [next-id (inc (apply max (conj (map :id ba) 0)))]
|
||||
(conj (vec ba) (assoc bank-account :id next-id)))))]
|
||||
(upsert id company)))
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user