Fix incorrect icon display for "Other SSIDs" on info page
The get_other_ssids function wasn't fetching symbol information from the database, causing icons to display incorrectly. Updated the query to include symbol_table_id and symbol_code fields and added them to the packet struct so render_symbol_html can properly display the icons. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
a0c2970b42
commit
c8bd7980c2
1 changed files with 5 additions and 3 deletions
|
|
@ -247,7 +247,7 @@ defmodule AprsmeWeb.InfoLive.Show do
|
||||||
query = """
|
query = """
|
||||||
WITH recent_ssids AS (
|
WITH recent_ssids AS (
|
||||||
SELECT DISTINCT ON (sender)
|
SELECT DISTINCT ON (sender)
|
||||||
sender, ssid, received_at, id
|
sender, ssid, received_at, id, symbol_table_id, symbol_code
|
||||||
FROM packets
|
FROM packets
|
||||||
WHERE base_callsign = $1
|
WHERE base_callsign = $1
|
||||||
AND received_at >= $2
|
AND received_at >= $2
|
||||||
|
|
@ -261,13 +261,15 @@ defmodule AprsmeWeb.InfoLive.Show do
|
||||||
|
|
||||||
case Repo.query(query, [base_callsign, one_hour_ago, callsign]) do
|
case Repo.query(query, [base_callsign, one_hour_ago, callsign]) do
|
||||||
{:ok, result} ->
|
{:ok, result} ->
|
||||||
Enum.map(result.rows, fn [sender, ssid, received_at, id] ->
|
Enum.map(result.rows, fn [sender, ssid, received_at, id, symbol_table_id, symbol_code] ->
|
||||||
# Create a minimal packet struct for display
|
# Create a minimal packet struct for display
|
||||||
packet = %Packet{
|
packet = %Packet{
|
||||||
id: id,
|
id: id,
|
||||||
sender: sender,
|
sender: sender,
|
||||||
ssid: ssid,
|
ssid: ssid,
|
||||||
received_at: received_at
|
received_at: received_at,
|
||||||
|
symbol_table_id: symbol_table_id,
|
||||||
|
symbol_code: symbol_code
|
||||||
}
|
}
|
||||||
|
|
||||||
%{
|
%{
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue