Skip to content
Snippets Groups Projects
Unverified Commit ffd787fc authored by Rodrigo Nascimento's avatar Rodrigo Nascimento
Browse files

Save channel as array for incoming integration always

parent 8572f69c
No related merge requests found
......@@ -69,6 +69,7 @@ Meteor.methods
integration.type = 'webhook-incoming'
integration.token = token
integration.channel = channels
integration.userId = user._id
integration._createdAt = new Date
integration._createdBy = RocketChat.models.Users.findOne @userId, {fields: {username: 1}}
......
RocketChat.Migrations.add({
version: 79,
up: function() {
const integrations = RocketChat.models.Integrations.find({type: 'webhook-incoming'}).fetch()
for (const integration of integrations) {
if (typeof integration.channel === 'string') {
RocketChat.models.Integrations.update({_id: integration._id}, {
$set: {
channel: integration.channel.split(',').map(channel => channel.trim())
}
});
}
}
}
});
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment