[FIX] title and value attachments are optionals on sendMessage method (#11021)

Closes #10739 and #10942 
Change required fields to optional, due to regressions in most integrations
pull/10095/head^2
Marcos Spessatto Defendi 7 years ago committed by Guilherme Gazzo
parent e3f7543115
commit 6e2d906b19
  1. 4
      packages/rocketchat-lib/server/functions/sendMessage.js

@ -20,7 +20,7 @@ const validateAttachmentsFields = attachmentFields => {
short: Boolean
}));
check(attachmentFields, Match.ObjectIncluding({
check(attachmentFields, objectMaybeIncluding({
title: String,
value: String
}));
@ -30,7 +30,7 @@ const validateAttachment = attachment => {
check(attachment, objectMaybeIncluding({
color: String,
text: String,
ts: String,
ts: Match.OneOf(String, Match.Integer),
thumb_url: String,
message_link: String,
collapsed: Boolean,

Loading…
Cancel
Save