reduces the number of duplicates that we try to import.
This commit is contained in:
@@ -102,7 +102,14 @@
|
|||||||
:db/id (random-tempid)
|
:db/id (random-tempid)
|
||||||
}]})))
|
}]})))
|
||||||
(filter :invoice/client)
|
(filter :invoice/client)
|
||||||
(into []))
|
(reduce (fn [[seen-so-far list] i]
|
||||||
|
(let [k [(:invoice/invoice-number i) (:invoice/client i)]]
|
||||||
|
(if (seen-so-far k)
|
||||||
|
[seen-so-far list]
|
||||||
|
[(conj seen-so-far k) (conj list i)])))
|
||||||
|
[#{} []])
|
||||||
|
(second)
|
||||||
|
)
|
||||||
(catch Exception e
|
(catch Exception e
|
||||||
(log/error ::cant-import-general-produce
|
(log/error ::cant-import-general-produce
|
||||||
:error e)
|
:error e)
|
||||||
|
|||||||
Reference in New Issue
Block a user