Skip to content

Commit

Permalink
Changed a thing that I made wrong.
Browse files Browse the repository at this point in the history
  • Loading branch information
JoseBambora committed Jul 24, 2022
1 parent 8fb50ca commit 83f5dc7
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion lib/karaokium_web/live/admin/karaoke_live/show.html.heex
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@
</section>
<div>
<span>
<%= live_patch("New Performance", to: Routes.admin_performance_new_path(@socket, :new, @karaoke.id, "admin")) %>
<%= live_patch("New Performance", to: Routes.admin_performance_new_path(@socket, :new, @karaoke.id)) %>
</span>
</div>
<% end %>
4 changes: 2 additions & 2 deletions lib/karaokium_web/live/admin/performance_live/new.ex
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ defmodule KaraokiumWeb.Admin.PerformanceLive.New do
end

@impl true
def handle_params(%{"karaoke_id" => karaoke_id, "return_to" => return_to}, _, socket) do
def handle_params(%{"karaoke_id" => karaoke_id}, _, socket) do
{:noreply,
socket
|> assign(:performance, %Performance{})
|> assign(:page_title, "New Performance")
|> assign(:karaoke_id, karaoke_id)
|> assign(:return_to, return_to)}
|> assign(:roles, socket.assigns.current_user.permissions)}
end
end
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<%= if @return_to == "live" do %>
<%= if @roles == [] do %>
<.live_component
module={KaraokiumWeb.Admin.PerformanceLive.FormComponent}
id={:new}
Expand Down
2 changes: 1 addition & 1 deletion lib/karaokium_web/live/karaoke_live/show.html.heex
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
text={"#{@karaoke.name} - Starting soon"}
/>
<span>
<%= live_patch("Create Performance", to: Routes.admin_performance_new_path(@socket, :new, @karaoke.id, "live")) %>
<%= live_patch("Create Performance", to: Routes.admin_performance_new_path(@socket, :new, @karaoke.id)) %>
</span>
<% else %>
<.status karaoke={@karaoke} />
Expand Down
2 changes: 1 addition & 1 deletion lib/karaokium_web/router.ex
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ defmodule KaraokiumWeb.Router do
live "/:id/show/edit", KaraokeLive.Show, :edit

live "/:karaoke_id/performances", PerformanceLive.Index, :index
live "/:karaoke_id/performances/new/:return_to", PerformanceLive.New, :new
live "/:karaoke_id/performances/new", PerformanceLive.New, :new
live "/:karaoke_id/performances/:id/edit", PerformanceLive.Edit, :edit
live "/:karaoke_id/performances/:id", PerformanceLive.Show, :show
live "/:karaoke_id/performances/:id/show/edit", PerformanceLive.Show, :edit
Expand Down

0 comments on commit 83f5dc7

Please sign in to comment.