~drewr/directory

dcb6e9ca3d33f9442191f4747534cd4240dfcef9 — Drew Raines 3 months ago 2d31144
When importing in bulk, set the entries inactive so they can be validated
1 files changed, 7 insertions(+), 0 deletions(-)

M src/directory/elasticsearch.clj
M src/directory/elasticsearch.clj => src/directory/elasticsearch.clj +7 -0
@@ 128,11 128,18 @@
  (merge root-doc
         {:business doc}))

(defn set-inactive [doc]
  (assoc-in doc [:business "status"] "inactive"))

(defn import-businesses [conn index file]
  (->> file
       biz/import-csv
       (map unqualify-keys)
       (map transform-object)
       ;; Often need a logo before they go live, and we don't support
       ;; that yet.  This lets the content coordinator go through and
       ;; approve manually after a bulk import.
       (map set-inactive)
       #_(filter conform)
       (index-seq conn index)))