-
Notifications
You must be signed in to change notification settings - Fork 71
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cleanup some handler code #651
Conversation
if err != nil { | ||
return status, err | ||
} | ||
jsonBody := jsonx.MustMarshal(payload) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these are structs we control... and we know they can't fail marshaling
@@ -719,16 +720,13 @@ func (h *handler) sendFacebookInstagramMsg(ctx context.Context, msg courier.MsgO | |||
// include any quick replies on the last piece we send | |||
if part.IsLast { | |||
for _, qr := range msg.QuickReplies() { | |||
payload.Message.QuickReplies = append(payload.Message.QuickReplies, messenger.QuickReply{qr, qr, "text"}) | |||
payload.Message.QuickReplies = append(payload.Message.QuickReplies, messenger.QuickReply{Title: qr, Payload: qr, ContentType: "text"}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
linter wasn't happy
@@ -1094,15 +1092,12 @@ func (h *handler) sendWhatsAppMsg(ctx context.Context, msg courier.MsgOut, clog | |||
return status, nil | |||
} | |||
|
|||
func requestWAC(payload whatsapp.SendRequest, accessToken string, status courier.StatusUpdate, wacPhoneURL *url.URL, zeroIndex bool, clog *courier.ChannelLog) (courier.StatusUpdate, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
redundant passing in status and returning it
Codecov Report
@@ Coverage Diff @@
## main #651 +/- ##
==========================================
+ Coverage 73.95% 74.24% +0.29%
==========================================
Files 99 99
Lines 13184 13147 -37
==========================================
+ Hits 9750 9761 +11
+ Misses 2729 2697 -32
+ Partials 705 689 -16
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
No description provided.