fix: convert binary UUID to text in activity feed sync query
Fixes Jason.EncodeError when rendering activity feed. PostgreSQL
array_agg was returning binary UUID which caused invalid UTF-8 bytes
when interpolated into 'sy-#{row.id}' string. Cast to ::text in the
fragment to ensure string representation.
This commit is contained in:
parent
053ad8b373
commit
180bfa6de2
1 changed files with 1 additions and 1 deletions
|
|
@ -301,7 +301,7 @@ defmodule Towerops.ActivityFeed do
|
|||
from(sl in SyncLog,
|
||||
where: sl.organization_id == ^org_id,
|
||||
select: %{
|
||||
id: fragment("(array_agg(? ORDER BY ? DESC))[1]", sl.id, sl.inserted_at),
|
||||
id: fragment("(array_agg(?::text ORDER BY ? DESC))[1]", sl.id, sl.inserted_at),
|
||||
timestamp: fragment("date_trunc('minute', ?)", sl.inserted_at),
|
||||
status: fragment("(array_agg(? ORDER BY ? DESC))[1]", sl.status, sl.inserted_at),
|
||||
records_synced: sum(sl.records_synced),
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue