scalar type for id simplifies parsing longs.

This commit is contained in:
Bryce Covert
2018-11-12 08:26:47 -08:00
parent 2263a5f24a
commit 6eaff40608
12 changed files with 80 additions and 81 deletions

View File

@@ -10,7 +10,7 @@
(defn upsert-vendor [context {{:keys [id name code print_as primary_contact secondary_contact address default_expense_account invoice_reminder_schedule] :as in} :vendor} value]
(let [transaction [(remove-nils #:vendor {:db/id (if id
(Long/parseLong id)
id
"vendor")
:name name
:code code
@@ -19,7 +19,7 @@
:invoice-reminder-schedule (keyword invoice_reminder_schedule)
:address (when address
(remove-nils #:address {:db/id (if (:id address)
(Long/parseLong (:id address))
(:id address)
"address")
:street1 (:street1 address)
:street2 (:street2 address)
@@ -29,7 +29,7 @@
:primary-contact (when primary_contact
(remove-nils #:contact {:db/id (if (:id primary_contact)
(Long/parseLong (:id primary_contact))
(:id primary_contact)
"primary")
:name (:name primary_contact)
:phone (:phone primary_contact)
@@ -38,7 +38,7 @@
:secondary-contact (when secondary_contact
(remove-nils #:contact {:db/id (if (:id secondary_contact)
(Long/parseLong (:id secondary_contact))
(:id secondary_contact)
"secondary")
:name (:name secondary_contact)
:phone (:phone secondary_contact)