some visual feedback that it worked

This commit is contained in:
BC
2018-07-12 23:31:39 -07:00
parent 29bbe10826
commit d6345832dc
2 changed files with 45 additions and 20 deletions

View File

@@ -89,14 +89,10 @@
(map #(str/split % #"\t"))
(map #(into {} (filter identity (map (fn [c k] [k c] ) % columns))))
(map (parse-or-error :amount parse-amount))
(map (parse-or-error :account-id parse-account-id))
(map (parse-or-error :date parse-date)))
error-rows (filter :errors rows)
raw-transactions (vec (->> rows
(filter #(not (seq (:errors %))) )
@@ -110,7 +106,8 @@
(manual-import raw-transactions company-id 1)
{:status 200
:body (pr-str {:status "success"})
:body (pr-str {:imported (count raw-transactions)
:errors (map #(dissoc % :date) error-rows)})
:headers {"Content-Type" "application/edn"}}))
)
(context "/invoices" []