Skip to content

Commit

Permalink
omit always empty fields in search
Browse files Browse the repository at this point in the history
  • Loading branch information
rusq committed Mar 26, 2024
1 parent 2dd6db5 commit 3c46349
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions search.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ type CtxChannel struct {
}

type CtxMessage struct {
User string `json:"user"`
Username string `json:"username"`
Text string `json:"text"`
Timestamp string `json:"ts"`
Type string `json:"type"`
User string `json:"user,omitempty"`
Username string `json:"username,omitempty"`
Text string `json:"text,omitempty"`
Timestamp string `json:"ts,omitempty"`
Type string `json:"type,omitempty"`
}

type SearchMessage struct {
Expand All @@ -51,12 +51,12 @@ type SearchMessage struct {
Timestamp string `json:"ts"`
Blocks Blocks `json:"blocks,omitempty"`
Text string `json:"text"`
Permalink string `json:"permalink"`
Attachments []Attachment `json:"attachments"`
Previous CtxMessage `json:"previous"`
Previous2 CtxMessage `json:"previous_2"`
Next CtxMessage `json:"next"`
Next2 CtxMessage `json:"next_2"`
Permalink string `json:"permalink,omitempty"`
Attachments []Attachment `json:"attachments,omitempty"`
Previous CtxMessage `json:"previous,omitempty"`
Previous2 CtxMessage `json:"previous_2,omitempty"`
Next CtxMessage `json:"next,omitempty"`
Next2 CtxMessage `json:"next_2,omitempty"`
}

type SearchMessages struct {
Expand Down

0 comments on commit 3c46349

Please sign in to comment.