fix device page
This commit is contained in:
parent
fc66109f19
commit
031880c954
1 changed files with 3 additions and 4 deletions
|
|
@ -55,10 +55,9 @@ defmodule ToweropsWeb.DeviceLive.Show do
|
|||
|> push_navigate(to: ~p"/devices")}
|
||||
|
||||
device ->
|
||||
# Preload site and organization to check access
|
||||
device = Repo.preload(device, site: :organization)
|
||||
|
||||
if device.site.organization_id == organization.id do
|
||||
# Check organization access using denormalized organization_id field
|
||||
# Works for both devices with sites and devices without sites
|
||||
if device.organization_id == organization.id do
|
||||
maybe_subscribe_and_schedule_refresh(socket, id)
|
||||
|
||||
tab = Map.get(params, "tab", "overview")
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue