(ns my-money.routes.upload
  (:require [my-money.op-csv :refer :all]
            [compojure.core :refer [defroutes POST]]
            [ring.util.http-response :as response]))

(defroutes upload-routes
  (POST "/upload" [file]
    (let [data (read-csv (slurp (:tempfile file)))]
      (-> (response/ok (-> data
                           (remove-column-by-name "Arkistointitunnus")))))))

(ns my-money.routes.upload
  (:require [my-money.op-csv :refer :all]
            [compojure.core :refer [defroutes POST]]
            [ring.util.http-response :as response]))

(defroutes upload-routes
  (POST "/upload" [file]
    (let [data (read-csv (slurp (:tempfile file) :encoding "ISO-8859-1"))]
      (-> (response/ok (-> data
                           (remove-column-by-name "Arvopäivä")
                           (remove-column-by-name "Laji")
                           (remove-column-by-name "Arkistointitunnus")))))))

Fix character encodings for the data read from the csv. Remove columns from the response.
Fix character encodings for the data read from the csv. Remove columns from the response.

Juholei/my-money,Juholei/my-money