Skip to content

Commit

Permalink
Merge pull request #17 from weni-ai/fix/zendesk-reopen
Browse files Browse the repository at this point in the history
Remove returned ticket in case of reopening for zendesk
  • Loading branch information
Robi9 authored Jun 9, 2023
2 parents 486713e + 0c4e5dc commit 0f8a0a1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion services/tickets/zendesk/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ func (s *service) Open(session flows.Session, topic *flows.Topic, body string, a
_, trace, _ := s.restClient.UpdateManyTickets(ids, statusOpen)
if trace != nil {
logHTTP(flows.NewHTTPLog(trace, flows.HTTPStatusFromCode, s.redactor))
return ticket, nil
return nil, nil
}
}

Expand Down
3 changes: 1 addition & 2 deletions services/tickets/zendesk/service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,8 @@ func TestOpenAndForward(t *testing.T) {
test.AssertSnapshot(t, "forward_message", logger.Logs[0].Request)

logger = &flows.HTTPLogger{}
ticket1, err := svc.Open(session, defaultTopic, fieldTicket1, nil, logger.Log)
_, err = svc.Open(session, defaultTopic, fieldTicket1, nil, logger.Log)
assert.NoError(t, err)
assert.Equal(t, fieldTicket1, ticket1.Body())
assert.Equal(t, 1, len(logger.Logs))
test.AssertSnapshot(t, "open", logger.Logs[0].Request)
}
Expand Down

0 comments on commit 0f8a0a1

Please sign in to comment.