feat: Remove restrictions on API channel webhook_url (#2261)
This commit is contained in:
@@ -56,7 +56,8 @@ import { required } from 'vuelidate/lib/validators';
|
||||
import router from '../../../../index';
|
||||
import PageHeader from '../../SettingsSubPageHeader';
|
||||
|
||||
const shouldBeWebhookUrl = (value = '') => value.startsWith('http');
|
||||
const shouldBeWebhookUrl = (value = '') =>
|
||||
value ? value.startsWith('http') : true;
|
||||
|
||||
export default {
|
||||
components: {
|
||||
@@ -76,7 +77,7 @@ export default {
|
||||
},
|
||||
validations: {
|
||||
channelName: { required },
|
||||
webhookUrl: { required, shouldBeWebhookUrl },
|
||||
webhookUrl: { shouldBeWebhookUrl },
|
||||
},
|
||||
methods: {
|
||||
async createChannel() {
|
||||
|
||||
@@ -59,7 +59,9 @@ class WebhookListener < BaseListener
|
||||
WebhookJob.perform_later(webhook.url, payload)
|
||||
end
|
||||
|
||||
# Deliver for API Inbox
|
||||
WebhookJob.perform_later(inbox.channel.webhook_url, payload) if inbox.channel_type == 'Channel::Api'
|
||||
return unless inbox.channel_type == 'Channel::Api'
|
||||
return if inbox.channel.webhook_url.blank?
|
||||
|
||||
WebhookJob.perform_later(inbox.channel.webhook_url, payload)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
# Table name: channel_api
|
||||
#
|
||||
# id :bigint not null, primary key
|
||||
# webhook_url :string not null
|
||||
# webhook_url :string
|
||||
# created_at :datetime not null
|
||||
# updated_at :datetime not null
|
||||
# account_id :integer not null
|
||||
|
||||
Reference in New Issue
Block a user