Add routing test and make ns name consistent

This commit is contained in:
Gabriel Horner
2022-12-09 17:23:22 -05:00
committed by Gabriel Horner
parent b4f26a5c7b
commit 6e0dea3f2c
7 changed files with 61 additions and 22 deletions

View File

@@ -1,4 +1,5 @@
(ns ^:no-doc frontend.handler.route
(ns frontend.handler.route
"Provides fns used for routing throughout the app"
(:require [clojure.string :as string]
[frontend.config :as config]
[frontend.date :as date]
@@ -62,7 +63,8 @@
:path-params {:name (str page-name)}}))
(defn redirect-to-page!
"Must ensure `page-name` is dereferenced (not an alias), or it will create a wrong new page with that name (#3511)."
"Must ensure `page-name` is dereferenced (not an alias), or it will create a
wrong new page with that name (#3511). page-name can be a block name or uuid"
([page-name]
(redirect-to-page! page-name {}))
([page-name {:keys [anchor push click-from-recent?]