Adds ezcater fikes.

This commit is contained in:
2023-02-23 21:27:02 -08:00
parent 6dd37bc93d
commit 98601e0cb6
3 changed files with 32 additions and 5 deletions

View File

@@ -45,6 +45,29 @@
;; this catches an error where you choose a parameter, change to invoices page, then change to voided invoices
(println "Error!" e)))))
(re-frame/reg-event-fx
::unset-selected
(fn [cofx [_ params suppress]]
(let [checked @(re-frame/subscribe [::data-page/checked ::page])
checked-params (get checked "header")
specific-transactions (map :id (vals (dissoc checked "header")))]
{:db (-> (:db cofx)
(assoc-in [:status :loading] true))
:graphql {:token (-> cofx :db :user)
:owns-state {:single ::delete-selected}
:query-obj
{:venia/operation {:operation/type :mutation
:operation/name "DeleteTransactions"}
:venia/queries [{:query/data
[:delete-transactions
{:filters (some-> checked-params data-params->query-params)
:ids specific-transactions
:suppress suppress}
[:message]]}]}
:on-success (fn [_]
[::params-change params])}
:dispatch-n [[::data-page/reset-checked ::page]
[::modal/modal-closed]]})))
(re-frame/reg-event-fx
::delete-selected
(fn [cofx [_ params suppress]]