Return logs on comms public reports

...and start to display them. A bit.
This commit is contained in:
Eli Ribble 2026-03-18 18:56:51 +00:00
parent 21e8b9880d
commit 685b7456b6
No known key found for this signature in database
11 changed files with 259 additions and 60 deletions

View file

@ -15,13 +15,8 @@ import (
//"github.com/rs/zerolog/log"
)
type historyEntry struct {
Action string `json:"action"`
Timestamp time.Time `json:"timestamp"`
}
type communication struct {
Created time.Time `json:"created"`
History []historyEntry `json:"history"`
ID string `json:"id"`
PublicReport types.PublicReport `json:"public_report"`
Type string `json:"type"`
@ -38,13 +33,7 @@ func listCommunication(ctx context.Context, r *http.Request, user platform.User,
comms := make([]communication, len(reports))
for i, report := range reports {
comms[i] = communication{
Created: report.Created,
History: []historyEntry{
historyEntry{
Action: "created",
Timestamp: report.Created,
},
},
Created: report.Created,
ID: report.PublicID,
PublicReport: report,
Type: "nuisance",