Skip to content

Commit

Permalink
feat: broadcast appointments list updates on save
Browse files Browse the repository at this point in the history
this is the broken state. Current.user will always be nil and therefore,
the edit link will fail to render for all attached clients
  • Loading branch information
avogel3 committed Jan 27, 2025
1 parent bb82cbf commit 1abc785
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/views/appointments/_appointment.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@
<dl class="flex w-full flex-none justify-between gap-x-8 sm:w-auto">
<div class="flex w-16 gap-x-2.5">
<span class="sr-only">Actions</span>
<%= link_to "Edit", edit_appointment_path(appointment), class: "text-xs text-indigo-500 hover:text-indigo-400", data: { turbo: false } %>
<% if appointment.created_by?(Current.user) %>
<%= link_to "Edit", edit_appointment_path(appointment), class: "text-xs text-indigo-500 hover:text-indigo-400", data: { turbo: false } %>
<% end %>
</div>
</dl>
</div>
Expand Down
2 changes: 2 additions & 0 deletions app/views/appointments/index.html.erb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
<%= turbo_stream_from "appointments_list" %>

<div class="flex flex-col mx-auto">
<h1 class="text-3xl font-bold tracking-tight text-gray-900">Appointments</h1>

Expand Down

0 comments on commit 1abc785

Please sign in to comment.