Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
Rocket.Chat
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
RocketChat
Rocket.Chat
Commits
ffeeded2
Commit
ffeeded2
authored
9 years ago
by
Rodrigo Nascimento
Browse files
Options
Downloads
Patches
Plain Diff
Close #1923; Prevent erros update outgoing webhooks with empty channel
parent
e68dacdf
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
packages/rocketchat-integrations/server/methods/outgoing/updateOutgoingIntegration.coffee
+7
-2
7 additions, 2 deletions
.../server/methods/outgoing/updateOutgoingIntegration.coffee
with
7 additions
and
2 deletions
packages/rocketchat-integrations/server/methods/outgoing/updateOutgoingIntegration.coffee
+
7
−
2
View file @
ffeeded2
...
@@ -17,7 +17,12 @@ Meteor.methods
...
@@ -17,7 +17,12 @@ Meteor.methods
if
integration
.
urls
.
length
is
0
if
integration
.
urls
.
length
is
0
throw
new
Meteor
.
Error
'invalid_urls'
,
'[methods] updateOutgoingIntegration -> urls is required'
throw
new
Meteor
.
Error
'invalid_urls'
,
'[methods] updateOutgoingIntegration -> urls is required'
if
integration
.
channel
?
.
trim
()
isnt
''
and
integration
.
channel
[
0
]
not
in
[
'@'
,
'#'
]
if
_
.
isString
(
integration
.
channel
)
integration
.
channel
=
integration
.
channel
.
trim
()
else
integration
.
channel
=
undefined
if
integration
.
channel
?
and
integration
.
channel
[
0
]
not
in
[
'@'
,
'#'
]
throw
new
Meteor
.
Error
'invalid_channel'
,
'[methods] updateOutgoingIntegration -> channel should start with # or @'
throw
new
Meteor
.
Error
'invalid_channel'
,
'[methods] updateOutgoingIntegration -> channel should start with # or @'
if
not
integration
.
token
?
or
integration
.
token
?
.
trim
()
is
''
if
not
integration
.
token
?
or
integration
.
token
?
.
trim
()
is
''
...
@@ -36,7 +41,7 @@ Meteor.methods
...
@@ -36,7 +41,7 @@ Meteor.methods
throw
new
Meteor
.
Error
'invalid_integration'
,
'[methods] updateOutgoingIntegration -> integration not found'
throw
new
Meteor
.
Error
'invalid_integration'
,
'[methods] updateOutgoingIntegration -> integration not found'
if
integration
.
channel
?
.
trim
()
isnt
''
if
integration
.
channel
?
record
=
undefined
record
=
undefined
channelType
=
integration
.
channel
[
0
]
channelType
=
integration
.
channel
[
0
]
channel
=
integration
.
channel
.
substr
(
1
)
channel
=
integration
.
channel
.
substr
(
1
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment