From d7b007bce3f3a5d3b3b12ba56f742ef81a79e505 Mon Sep 17 00:00:00 2001 From: Dmitry Shurco Date: Mon, 31 Jul 2023 08:52:33 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9E=20fix:=20404=20error=20template=20?= =?UTF-8?q?wasn't=20displayed?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/routes/not_found_route.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/internal/routes/not_found_route.go b/internal/routes/not_found_route.go index 02359d8..6a9d0c9 100644 --- a/internal/routes/not_found_route.go +++ b/internal/routes/not_found_route.go @@ -13,6 +13,9 @@ func NotFoundRoute(a *fiber.App) { if strings.HasPrefix(c.Path(), "/api") { return webutil.Response(c, fiber.StatusNotFound, "Not Found", nil) } - return c.Status(fiber.StatusNotFound).Render("error/404", fiber.Map{}, "site/layouts/clear") + if strings.HasPrefix(c.Path(), "/_") { + return c.Status(fiber.StatusNotFound).Render("admin/404", fiber.Map{}, "admin/layouts/clear") + } + return c.Status(fiber.StatusNotFound).Render("site/404", fiber.Map{}, "site/layouts/clear") }) }