Skip to content

Commit

Permalink
[FIX] Broken slack compatible webhook (#11742)
Browse files Browse the repository at this point in the history
  • Loading branch information
geekgonecrazy authored and sampaiodiego committed Sep 20, 2018
1 parent 4c558f6 commit e599ab7
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions packages/rocketchat-lib/server/functions/sendMessage.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,17 @@ const objectMaybeIncluding = (types) => Match.Where((value) => {
return true;
});

const validateAttachmentsFields = (attachmentFields) => {
check(attachmentFields, objectMaybeIncluding({
const validateAttachmentsFields = (attachmentField) => {
check(attachmentField, objectMaybeIncluding({
short: Boolean,
}));

check(attachmentFields, objectMaybeIncluding({
title: String,
value: String,
value: Match.OneOf(String, Match.Integer, Boolean),
}));

if (typeof attachmentField.value !== 'undefined') {
attachmentField.value = String(attachmentField.value);
}

};

const validateAttachmentsActions = (attachmentActions) => {
Expand Down

0 comments on commit e599ab7

Please sign in to comment.