Skip to content

Commit

Permalink
Remove old body field on ticket modifier
Browse files Browse the repository at this point in the history
  • Loading branch information
rowanseymour committed Aug 8, 2024
1 parent fd2006e commit b2353db
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 11 deletions.
6 changes: 2 additions & 4 deletions flows/modifiers/testdata/ticket.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@
"email": "[email protected]",
"name": "Bob"
},
"note": "this is a note",
"body": "this is a note"
"note": "this is a note"
},
"contact_after": {
"uuid": "5d76d86b-3bb9-4d5a-b822-c9d86f5d8e4f",
Expand Down Expand Up @@ -85,8 +84,7 @@
"name": "Computers"
},
"assignee": null,
"note": "Should fail",
"body": "Should fail"
"note": "Should fail"
},
"contact_after": {
"uuid": "5d76d86b-3bb9-4d5a-b822-c9d86f5d8e4f",
Expand Down
7 changes: 0 additions & 7 deletions flows/modifiers/ticket.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,6 @@ type ticketModifierEnvelope struct {
Topic *assets.TopicReference `json:"topic" validate:"required"`
Assignee *assets.UserReference `json:"assignee"`
Note string `json:"note"`

Body string `json:"body"` // deprecated
}

func readTicketModifier(assets flows.SessionAssets, data json.RawMessage, missing assets.MissingCallback) (flows.Modifier, error) {
Expand All @@ -73,10 +71,6 @@ func readTicketModifier(assets flows.SessionAssets, data json.RawMessage, missin
return nil, err
}

if e.Note == "" && e.Body != "" {
e.Note = e.Body
}

topic := assets.Topics().Get(e.Topic.UUID)
if topic == nil {
missing(e.Topic, nil)
Expand All @@ -100,6 +94,5 @@ func (m *TicketModifier) MarshalJSON() ([]byte, error) {
Topic: m.topic.Reference(),
Assignee: m.assignee.Reference(),
Note: m.note,
Body: m.note,
})
}

0 comments on commit b2353db

Please sign in to comment.