From 16a0606e4c6bc07676895e0d132d671bcc18ea33 Mon Sep 17 00:00:00 2001 From: Daniel Ponte Date: Sat, 4 Jan 2025 10:38:52 -0500 Subject: [PATCH] Cannot tag excluded field --- pkg/calls/call.go | 6 +++--- pkg/database/calls.sql.go | 2 +- pkg/database/querier.go | 2 +- pkg/rest/incidents.go | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/pkg/calls/call.go b/pkg/calls/call.go index 5c784cb..8c1617d 100644 --- a/pkg/calls/call.go +++ b/pkg/calls/call.go @@ -42,18 +42,18 @@ type CallAudio struct { } type Call struct { - ID uuid.UUID `json:"-"` + ID uuid.UUID `json:"id"` Audio []byte `json:"audio,omitempty" filenameField:"AudioName"` AudioName string `json:"audioName,omitempty"` AudioType string `json:"audioType,omitempty"` - Duration CallDuration `json:"-"` + Duration CallDuration `json:"duration,omitempty"` DateTime time.Time `json:"dateTime,omitempty"` Frequencies []int `json:"frequencies,omitempty"` Frequency int `json:"frequency,omitempty"` Patches []int `json:"patches,omitempty"` Source int `json:"source,omitempty"` System int `json:"system,omitempty"` - Submitter *auth.UserID `json:"-,omitempty"` + Submitter *auth.UserID `json:"submitter,omitempty"` SystemLabel string `json:"systemLabel,omitempty"` Talkgroup int `json:"talkgroup,omitempty"` TalkgroupGroup *string `json:"talkgroupGroup,omitempty"` diff --git a/pkg/database/calls.sql.go b/pkg/database/calls.sql.go index 1129b5e..a58588f 100644 --- a/pkg/database/calls.sql.go +++ b/pkg/database/calls.sql.go @@ -147,7 +147,6 @@ WITH to_sweep AS ( WHERE call_id IN (SELECT id FROM to_sweep) ` -// This is used to sweep calls that are part of an incident prior to pruning a partition. func (q *Queries) CleanupSweptCalls(ctx context.Context, rangeStart pgtype.Timestamptz, rangeEnd pgtype.Timestamptz) (int64, error) { result, err := q.db.Exec(ctx, cleanupSweptCalls, rangeStart, rangeEnd) if err != nil { @@ -366,6 +365,7 @@ WITH to_sweep AS ( ) INSERT INTO swept_calls SELECT id, submitter, system, talkgroup, call_date, audio_name, audio_blob, duration, audio_type, audio_url, frequency, frequencies, patches, tg_label, tg_alpha_tag, tg_group, source, transcript FROM to_sweep ` +// This is used to sweep calls that are part of an incident prior to pruning a partition. func (q *Queries) SweepCalls(ctx context.Context, rangeStart pgtype.Timestamptz, rangeEnd pgtype.Timestamptz) (int64, error) { result, err := q.db.Exec(ctx, sweepCalls, rangeStart, rangeEnd) if err != nil { diff --git a/pkg/database/querier.go b/pkg/database/querier.go index f8f15e2..4ef8f5e 100644 --- a/pkg/database/querier.go +++ b/pkg/database/querier.go @@ -16,7 +16,6 @@ type Querier interface { AddCall(ctx context.Context, arg AddCallParams) error AddLearnedTalkgroup(ctx context.Context, arg AddLearnedTalkgroupParams) (Talkgroup, error) AddToIncident(ctx context.Context, incidentID uuid.UUID, callIds []uuid.UUID, notes [][]byte) error - // This is used to sweep calls that are part of an incident prior to pruning a partition. CleanupSweptCalls(ctx context.Context, rangeStart pgtype.Timestamptz, rangeEnd pgtype.Timestamptz) (int64, error) CreateAPIKey(ctx context.Context, owner int, expires pgtype.Timestamp, disabled *bool) (ApiKey, error) CreateIncident(ctx context.Context, arg CreateIncidentParams) (Incident, error) @@ -62,6 +61,7 @@ type Querier interface { SetTalkgroupTags(ctx context.Context, tags []string, systemID int32, tGID int32) error StoreDeletedTGVersion(ctx context.Context, systemID *int32, tGID *int32, submitter *int32) error StoreTGVersion(ctx context.Context, arg []StoreTGVersionParams) *StoreTGVersionBatchResults + // This is used to sweep calls that are part of an incident prior to pruning a partition. SweepCalls(ctx context.Context, rangeStart pgtype.Timestamptz, rangeEnd pgtype.Timestamptz) (int64, error) UpdateCallIncidentNotes(ctx context.Context, notes []byte, incidentID uuid.UUID, callID uuid.UUID) error UpdateIncident(ctx context.Context, arg UpdateIncidentParams) (Incident, error) diff --git a/pkg/rest/incidents.go b/pkg/rest/incidents.go index b586345..e69f5f2 100644 --- a/pkg/rest/incidents.go +++ b/pkg/rest/incidents.go @@ -56,7 +56,7 @@ func (ia *incidentsAPI) listIncidents(w http.ResponseWriter, r *http.Request) { res := struct { Incidents []incstore.Incident `json:"incidents"` - Count int `json:"count"` + Count int `json:"count"` }{} res.Incidents, res.Count, err = incs.Incidents(ctx, p)