Skip to content

Commit

Permalink
Merge pull request #1281 from nyaruka/ticket_mod_cleanup
Browse files Browse the repository at this point in the history
Remove old body field on ticket modifier
  • Loading branch information
rowanseymour authored Aug 8, 2024
2 parents fd2006e + b2353db commit b207dbd
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 b207dbd

Please sign in to comment.