skip null worknotes
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2025-03-26 12:17:21 +11:00
parent 0e9591e6fc
commit 34552985b7

View File

@@ -109,7 +109,9 @@ func (h *Handler) GetIncident(w http.ResponseWriter, r *http.Request) {
// get worknotes for this incident
for _, note := range wknList {
if note.IncidentNumber == inc.IncidentNumber.String {
wkn = append(wkn, note.Note.String)
if note.Note.Valid {
wkn = append(wkn, note.Note.String)
}
}
}
@@ -214,7 +216,10 @@ func (h *Handler) getSingleIncident(number string, ctx context.Context) ([]byte,
}
for _, note := range wknotes {
wkn = append(wkn, note.Note.String)
if note.Note.Valid {
wkn = append(wkn, note.Note.String)
}
}
// convert from database resposne to expected json format