From fe30806735fa11f60bbf04d11aed6a2ba0ee8174 Mon Sep 17 00:00:00 2001 From: Juha Halmu Date: Sun, 1 Sep 2024 12:05:04 +0300 Subject: [PATCH] Fixed routeorder "new" have to be before ":id" --- lib/kotisivut_web/router.ex | 10 ++++------ mix.exs | 2 +- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/lib/kotisivut_web/router.ex b/lib/kotisivut_web/router.ex index f72fc59..a5d4576 100644 --- a/lib/kotisivut_web/router.ex +++ b/lib/kotisivut_web/router.ex @@ -19,11 +19,12 @@ defmodule KotisivutWeb.Router do scope "/", KotisivutWeb do pipe_through :browser - - get "/", PageController, :home - live "/posts", PostLive.Index, :index + live "/posts/new", PostLive.Index, :new live "/posts/:id", PostLive.Show, :show + live "/posts/:id/edit", PostLive.Index, :edit + live "/posts/:id/show/edit", PostLive.Show, :edit + get "/", PageController, :home end # Other scopes may use custom stacks. @@ -71,9 +72,6 @@ defmodule KotisivutWeb.Router do on_mount: [{KotisivutWeb.UserAuth, :ensure_authenticated}] do live "/users/settings", UserSettingsLive, :edit live "/users/settings/confirm_email/:token", UserSettingsLive, :confirm_email - live "/posts/new", PostLive.Index, :new - live "/posts/:id/edit", PostLive.Index, :edit - live "/posts/:id/show/edit", PostLive.Show, :edit end end diff --git a/mix.exs b/mix.exs index cc7bc05..4864365 100644 --- a/mix.exs +++ b/mix.exs @@ -40,7 +40,7 @@ defmodule Kotisivut.MixProject do {:phoenix_html, "~> 4.1"}, {:phoenix_live_reload, "~> 1.2", only: :dev}, # TODO bump on release to {:phoenix_live_view, "~> 1.0.0"}, - {:phoenix_live_view, "~> 1.0.0-rc.6", override: true}, + {:phoenix_live_view, "~> 1.0.0-rc.1", override: true}, {:floki, ">= 0.30.0", only: :test}, {:phoenix_live_dashboard, "~> 0.8.3"}, {:esbuild, "~> 0.8", runtime: Mix.env() == :dev},