feat: add webhook body template and headers support for channels
This commit is contained in:
@@ -56,6 +56,14 @@ pub(super) async fn create_channel(
|
||||
channel.webhook_poll_interval_secs = interval;
|
||||
changed = true;
|
||||
}
|
||||
if let Some(tmpl) = payload.webhook_body_template {
|
||||
channel.webhook_body_template = Some(tmpl);
|
||||
changed = true;
|
||||
}
|
||||
if let Some(headers) = payload.webhook_headers {
|
||||
channel.webhook_headers = Some(headers);
|
||||
changed = true;
|
||||
}
|
||||
if changed {
|
||||
channel = state.channel_service.update(channel).await?;
|
||||
}
|
||||
@@ -126,6 +134,12 @@ pub(super) async fn update_channel(
|
||||
if let Some(interval) = payload.webhook_poll_interval_secs {
|
||||
channel.webhook_poll_interval_secs = interval;
|
||||
}
|
||||
if let Some(tmpl) = payload.webhook_body_template {
|
||||
channel.webhook_body_template = tmpl;
|
||||
}
|
||||
if let Some(headers) = payload.webhook_headers {
|
||||
channel.webhook_headers = headers;
|
||||
}
|
||||
channel.updated_at = Utc::now();
|
||||
|
||||
let channel = state.channel_service.update(channel).await?;
|
||||
|
||||
Reference in New Issue
Block a user