Skip to content

Commit 83f5dc7

Browse files
committed
Changed a thing that I made wrong.
1 parent 8fb50ca commit 83f5dc7

File tree

5 files changed

+6
-6
lines changed

5 files changed

+6
-6
lines changed

lib/karaokium_web/live/admin/karaoke_live/show.html.heex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@
175175
</section>
176176
<div>
177177
<span>
178-
<%= live_patch("New Performance", to: Routes.admin_performance_new_path(@socket, :new, @karaoke.id, "admin")) %>
178+
<%= live_patch("New Performance", to: Routes.admin_performance_new_path(@socket, :new, @karaoke.id)) %>
179179
</span>
180180
</div>
181181
<% end %>

lib/karaokium_web/live/admin/performance_live/new.ex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ defmodule KaraokiumWeb.Admin.PerformanceLive.New do
1010
end
1111

1212
@impl true
13-
def handle_params(%{"karaoke_id" => karaoke_id, "return_to" => return_to}, _, socket) do
13+
def handle_params(%{"karaoke_id" => karaoke_id}, _, socket) do
1414
{:noreply,
1515
socket
1616
|> assign(:performance, %Performance{})
1717
|> assign(:page_title, "New Performance")
1818
|> assign(:karaoke_id, karaoke_id)
19-
|> assign(:return_to, return_to)}
19+
|> assign(:roles, socket.assigns.current_user.permissions)}
2020
end
2121
end

lib/karaokium_web/live/admin/performance_live/new.html.heex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<%= if @return_to == "live" do %>
1+
<%= if @roles == [] do %>
22
<.live_component
33
module={KaraokiumWeb.Admin.PerformanceLive.FormComponent}
44
id={:new}

lib/karaokium_web/live/karaoke_live/show.html.heex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171
text={"#{@karaoke.name} - Starting soon"}
7272
/>
7373
<span>
74-
<%= live_patch("Create Performance", to: Routes.admin_performance_new_path(@socket, :new, @karaoke.id, "live")) %>
74+
<%= live_patch("Create Performance", to: Routes.admin_performance_new_path(@socket, :new, @karaoke.id)) %>
7575
</span>
7676
<% else %>
7777
<.status karaoke={@karaoke} />

lib/karaokium_web/router.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ defmodule KaraokiumWeb.Router do
101101
live "/:id/show/edit", KaraokeLive.Show, :edit
102102

103103
live "/:karaoke_id/performances", PerformanceLive.Index, :index
104-
live "/:karaoke_id/performances/new/:return_to", PerformanceLive.New, :new
104+
live "/:karaoke_id/performances/new", PerformanceLive.New, :new
105105
live "/:karaoke_id/performances/:id/edit", PerformanceLive.Edit, :edit
106106
live "/:karaoke_id/performances/:id", PerformanceLive.Show, :show
107107
live "/:karaoke_id/performances/:id/show/edit", PerformanceLive.Show, :edit

0 commit comments

Comments
 (0)