Skip to content
Snippets Groups Projects
Unverified Commit fb9da630 authored by Noah Moss's avatar Noah Moss Committed by GitHub
Browse files

Fix schema error in recent views query (#42844)

parent 8477f8db
No related branches found
No related tags found
No related merge requests found
......@@ -133,7 +133,7 @@
[:and {:registry {::pc [:map
[:id [:or [:int {:min 1}] [:= "root"]]]
[:name :string]
[:authority_level [:enum :official nil]]]}}
[:authority_level [:enum :official "official" nil]]]}}
[:map
[:id [:int {:min 1}]]
[:name :string]
......@@ -157,7 +157,7 @@
[:name :string]]]]]
[:collection [:map
[:parent_collection ::pc]
[:authority_level [:enum :official nil]]]]]])
[:authority_level [:enum :official "official" nil]]]]]])
(defmulti fill-recent-view-info
"Fills in additional information for a recent view, such as the display name of the object.
......@@ -353,14 +353,14 @@
:initial_sync_status (:initial-sync-status table)}})))
(defn ^:private do-query [user-id] (t2/select :model/RecentViews {:select [:rv.* [:rc.type :card_type]]
:from [[:recent_views :rv]]
:where [:and [:= :rv.user_id user-id]]
:left-join [[:report_card :rc]
[:and
;; only want to join on card_type if it's a card
[:= :rv.model "card"]
[:= :rc.id :rv.model_id]]]
:order-by [[:rv.timestamp :desc]]}))
:from [[:recent_views :rv]]
:where [:and [:= :rv.user_id user-id]]
:left-join [[:report_card :rc]
[:and
;; only want to join on card_type if it's a card
[:= :rv.model "card"]
[:= :rc.id :rv.model_id]]]
:order-by [[:rv.timestamp :desc]]}))
(mu/defn ^:private model->return-model [model :- :keyword]
(if (= :question model) :card model))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment