From 51298ea998bff64b521fe0a392ad340271d40f07 Mon Sep 17 00:00:00 2001 From: Logan Hunt Date: Wed, 13 Apr 2022 14:17:28 -0600 Subject: Add room id to routes and fix authorization on said routes --- lib/aggiedit_web/live/post_live/index.html.heex | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'lib/aggiedit_web/live/post_live/index.html.heex') diff --git a/lib/aggiedit_web/live/post_live/index.html.heex b/lib/aggiedit_web/live/post_live/index.html.heex index 1804971..329f84c 100644 --- a/lib/aggiedit_web/live/post_live/index.html.heex +++ b/lib/aggiedit_web/live/post_live/index.html.heex @@ -1,7 +1,7 @@

Listing Posts

<%= if @live_action in [:new, :edit] do %> - <.modal return_to={Routes.post_index_path(@socket, :index)}> + <.modal return_to={Routes.post_index_path(@socket, :index, @room)}> <.live_component current_user={@current_user} module={AggieditWeb.PostLive.FormComponent} @@ -9,7 +9,7 @@ title={@page_title} action={@live_action} post={@post} - return_to={Routes.post_index_path(@socket, :index)} + return_to={Routes.post_index_path(@socket, :index, @room)} /> <% end %> @@ -30,8 +30,8 @@ <%= post.body %> - <%= live_redirect "Show", to: Routes.post_show_path(@socket, :show, post) %> - <%= live_patch "Edit", to: Routes.post_index_path(@socket, :edit, post) %> + <%= live_redirect "Show", to: Routes.post_show_path(@socket, :show, @room, post) %> + <%= live_patch "Edit", to: Routes.post_index_path(@socket, :edit, @room, post) %> <%= link "Delete", to: "#", phx_click: "delete", phx_value_id: post.id, data: [confirm: "Are you sure?"] %> @@ -39,4 +39,4 @@ -<%= live_patch "New Post", to: Routes.post_index_path(@socket, :new) %> +<%= live_patch "New Post", to: Routes.post_index_path(@socket, :new, @room) %> -- cgit v1.2.3-70-g09d2