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

Enforce data in body params

parent 08593fc6
No related branches found
No related tags found
No related merge requests found
......@@ -124,6 +124,8 @@ Api.addRoute 'add/:integrationId/:userId/:token', authRequired: true,
Meteor.runAsUser user._id, =>
switch @bodyParams['event']
when 'newMessageOnChannel'
@bodyParams.data ?= {}
if @bodyParams.data.channel_name? and @bodyParams.data.channel_name.indexOf('#') is -1
@bodyParams.data.channel_name = '#' + @bodyParams.data.channel_name
......
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