DB refactor and fix issues related to tags and aliases

1. add a `page` filter.
2. keep word case for both page and block's properties
3. remove `:tag/name` from the db schema

Fixed #1031
This commit is contained in:
Tienson Qin
2021-01-02 18:27:48 +08:00
parent 8f6d16d041
commit 48b6ccbdca
14 changed files with 158 additions and 202 deletions

View File

@@ -165,7 +165,6 @@
[]
(let [match (:route-match @state/state)
route-name (get-in match [:data :name])
tag? (= route-name :tag)
page (case route-name
:page
(get-in match [:path-params :name])
@@ -173,15 +172,10 @@
:file
(get-in match [:path-params :path])
:tag
(get-in match [:path-params :name])
(date/journal-name))]
(when page
(let [page-name (util/url-decode (string/lower-case page))]
(db-utils/entity (if tag?
[:tag/name page-name]
[:page/name page-name]))))))
(db-utils/entity [:page/name page-name])))))
(defn get-current-priority
[]