You can update locations

This commit is contained in:
Bryce Covert
2018-06-15 17:21:45 -07:00
parent b06a6651ca
commit e749b3eb23
7 changed files with 31 additions and 7 deletions

View File

@@ -107,6 +107,7 @@
{:fields {:id {:type 'Int}
:invoice_id {:type 'Int}
:expense_account_id {:type 'Int}
:location {:type 'String}
:expense_account {:type :expense_account
:resolve :get-expense-account}
:amount {:type 'String}}}
@@ -213,6 +214,7 @@
:edit_expense_account
{:fields {:id {:type 'Int}
:expense_account_id {:type 'Int}
:location {:type 'String}
:amount {:type 'String}}}
:add_invoice

View File

@@ -29,9 +29,10 @@
(invoices-expense-accounts/get-for-invoice (:id value))))
(defn edit-expense-accounts [context args value]
(invoices-expense-accounts/replace-for-invoice (:invoice_id args) (map (fn [{:keys [id expense_account_id amount]}]
(invoices-expense-accounts/replace-for-invoice (:invoice_id args) (map (fn [{:keys [id expense_account_id amount location]}]
{
:expense-account-id expense_account_id
:location location
:amount (Double/parseDouble amount)} )
(:expense_accounts args)))
(->graphql