Browse Source

refactor update function name convertFileToBuffer to convertFileToBytes

pull/4/head
Dimas Restu H 4 years ago
parent
commit
c3ce762388
  1. 4
      internal/whatsapp/whatsapp.go

4
internal/whatsapp/whatsapp.go

@ -24,7 +24,7 @@ func jwtPayload(c echo.Context) typAuth.AuthJWTClaimsPayload {
return jwtClaims.Data return jwtClaims.Data
} }
func convertFileToBuffer(file multipart.File) ([]byte, error) {
func convertFileToBytes(file multipart.File) ([]byte, error) {
// Create Empty Buffer // Create Empty Buffer
buffer := bytes.NewBuffer(nil) buffer := bytes.NewBuffer(nil)
@ -84,7 +84,7 @@ func sendMedia(c echo.Context, mediaType string) error {
// Convert File Stream in to Bytes // Convert File Stream in to Bytes
// Since WhatsApp Proto for Media is only Accepting Bytes format // Since WhatsApp Proto for Media is only Accepting Bytes format
fileBytes, err := convertFileToBuffer(fileStream)
fileBytes, err := convertFileToBytes(fileStream)
if err != nil { if err != nil {
return router.ResponseInternalError(c, err.Error()) return router.ResponseInternalError(c, err.Error())
} }

Loading…
Cancel
Save