Skip to content

Commit

Permalink
Merge pull request #29 from weni-ai/feat/param-rocket
Browse files Browse the repository at this point in the history
Feat/param rocket
  • Loading branch information
Robi9 authored Jul 12, 2023
2 parents 0d38225 + 1f65ec6 commit fdf5e32
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
11 changes: 4 additions & 7 deletions core/tasks/handler/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -767,16 +767,13 @@ func handleTicketEvent(ctx context.Context, rt *runtime.Runtime, event *models.T

var params *types.XObject
if event.Note() != "" {
note := struct {
Event string `json:"event"`
ID int `json:"id"`
Status string `json:"status"`
}{}
err := json.Unmarshal([]byte(event.Note()), &note)
var values map[string]interface{}

err := json.Unmarshal([]byte(event.Note()), &values)
if err != nil {
log.WithError(err).Error("unable to unmarshal note from ticket event")
}
asJSON, err := json.Marshal(note)
asJSON, err := json.Marshal(values)
if err != nil {
log.WithError(err).Error("unable to marshal note from ticket event")
}
Expand Down
3 changes: 2 additions & 1 deletion services/tickets/rocketchat/web.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,8 @@ func handleEventCallback(ctx context.Context, rt *runtime.Runtime, r *http.Reque
_, err = tickets.SendReply(ctx, rt, ticket, data.Text, files)

case "close-room":
err = tickets.Close(ctx, rt, oa, ticket, false, l, "")
requestJSON, _ := json.Marshal(request)
err = tickets.Close(ctx, rt, oa, ticket, false, l, string(requestJSON))

default:
err = errors.New("invalid event type")
Expand Down

0 comments on commit fdf5e32

Please sign in to comment.