bugfix GetIncidentReport
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2025-03-25 18:53:59 +11:00
parent e161219aaa
commit c1fdc1f9a6
2 changed files with 3 additions and 3 deletions

View File

@@ -56,7 +56,7 @@ WHERE incident_number = sqlc.arg('incidentNumber');
SELECT * FROM incidents; SELECT * FROM incidents;
-- name: GetIncidentReport :many -- name: GetIncidentReport :many
SELECT incidents.*, GROUP_CONCAT(worknotes.note, '<br />') AS all_notes SELECT incidents.*, IFNULL(GROUP_CONCAT(worknotes.note, '<br />'), ' ') AS all_notes
FROM incidents LEFT JOIN worknotes ON incidents.incident_number = worknotes.incident_number FROM incidents LEFT JOIN worknotes ON incidents.incident_number = worknotes.incident_number
GROUP BY incidents.id; GROUP BY incidents.id;

View File

@@ -184,7 +184,7 @@ func (q *Queries) GetIncident(ctx context.Context, incidentnumber sql.NullString
} }
const getIncidentReport = `-- name: GetIncidentReport :many const getIncidentReport = `-- name: GetIncidentReport :many
SELECT incidents.id, incidents.external_id, incidents.created_at, incidents.incident_number, incidents.description, incidents.short_description, incidents.urgency, incidents.impact, incidents.state, incidents.assignment_group, incidents.assigned_to, incidents.category, incidents.sub_category, incidents.sys_id, GROUP_CONCAT(worknotes.note, '<br />') AS all_notes SELECT incidents.id, incidents.external_id, incidents.created_at, incidents.incident_number, incidents.description, incidents.short_description, incidents.urgency, incidents.impact, incidents.state, incidents.assignment_group, incidents.assigned_to, incidents.category, incidents.sub_category, incidents.sys_id, IFNULL(GROUP_CONCAT(worknotes.note, '<br />'), ' ') AS all_notes
FROM incidents LEFT JOIN worknotes ON incidents.incident_number = worknotes.incident_number FROM incidents LEFT JOIN worknotes ON incidents.incident_number = worknotes.incident_number
GROUP BY incidents.id GROUP BY incidents.id
` `
@@ -204,7 +204,7 @@ type GetIncidentReportRow struct {
Category sql.NullString Category sql.NullString
SubCategory sql.NullString SubCategory sql.NullString
SysID sql.NullString SysID sql.NullString
AllNotes string AllNotes interface{}
} }
func (q *Queries) GetIncidentReport(ctx context.Context) ([]GetIncidentReportRow, error) { func (q *Queries) GetIncidentReport(ctx context.Context) ([]GetIncidentReportRow, error) {