a variety of bug fixes.
This commit is contained in:
@@ -46,15 +46,19 @@
|
||||
::input-value-settled
|
||||
[with-user]
|
||||
(fn [{:keys [user]} [_ input-value search-query set-items set-loading-status]]
|
||||
(when (> (count input-value) 2)
|
||||
(set-loading-status :loading)
|
||||
(if (re-matches #"[a-zA-Z0-9\s\-]+" input-value)
|
||||
(when (> (count input-value) 2)
|
||||
(set-loading-status :loading)
|
||||
|
||||
|
||||
{:graphql {:token user
|
||||
:query-obj {:venia/queries [{:query/data (search-query input-value )
|
||||
:query/alias :search-results}]}
|
||||
:on-success [::search-completed set-items set-loading-status]
|
||||
:on-error [::search-failed set-loading-status]}})))
|
||||
|
||||
{:graphql {:token user
|
||||
:query-obj {:venia/queries [{:query/data (search-query input-value )
|
||||
:query/alias :search-results}]}
|
||||
:on-success [::search-completed set-items set-loading-status]
|
||||
:on-error [::search-failed set-loading-status]}})
|
||||
(do
|
||||
(set-loading-status nil)
|
||||
{}))))
|
||||
|
||||
;; TODO: This avoids the use of inferred externs by using aget. You could just use the ^js tag though
|
||||
(defn state-reducer [^js/FakeStateObject state ^js/FakeActionsAndChanges actions-and-changes]
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
:start (:start params 0)
|
||||
:per-page (:per-page params)
|
||||
:name-like (:name-like params)
|
||||
:numeric-code (some-> params :numeric-code not-empty js/parseInt)}
|
||||
:numeric-code (some-> params :numeric-code not-empty js/parseInt (#(if (js/Number.isNaN %) nil %)))}
|
||||
[[:accounts default-read]
|
||||
:total
|
||||
:start
|
||||
|
||||
@@ -211,14 +211,15 @@
|
||||
::mounted
|
||||
[with-user (re-frame/inject-cofx ::inject/sub [::subs/route-params])]
|
||||
(fn [{:keys [user db] ::subs/keys [route-params]} _]
|
||||
{:graphql {:token user
|
||||
:query-obj {:venia/queries [[:admin-client
|
||||
{:id (js/parseInt (:id route-params))}
|
||||
(events/client-detail-query user)]]}
|
||||
:on-success (fn [result]
|
||||
[::received (:admin-client result)])}
|
||||
:db (-> db
|
||||
(forms/stop-form ::form))}))
|
||||
(when-let [id (some-> (:id route-params) (js/parseInt ) (#(if (js/Number.isNaN %) nil %)))]
|
||||
{:graphql {:token user
|
||||
:query-obj {:venia/queries [[:admin-client
|
||||
{:id id}
|
||||
(events/client-detail-query user)]]}
|
||||
:on-success (fn [result]
|
||||
[::received (:admin-client result)])}
|
||||
:db (-> db
|
||||
(forms/stop-form ::form))})))
|
||||
|
||||
(re-frame/reg-event-db
|
||||
::received
|
||||
|
||||
Reference in New Issue
Block a user