UI - update type, handle null in one more place (#17569)

Follow-up to #17548 

- [x] Manual QA for all new/changed functionality

Co-authored-by: Jacob Shandling <jacob@fleetdm.com>
This commit is contained in:
Jacob Shandling 2024-03-12 13:39:35 -05:00 committed by GitHub
parent 8578e1ab53
commit c112f4425d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 6 deletions

View File

@ -214,8 +214,7 @@ export interface IConfig {
export interface IWebhookSettings {
failing_policies_webhook: IWebhookFailingPolicies;
// TODO - this can be null
host_status_webhook: IWebhookHostStatus;
host_status_webhook: IWebhookHostStatus | null;
vulnerabilities_webhook: IWebhookSoftwareVulnerabilities;
}

View File

@ -45,13 +45,13 @@ const GlobalHostStatusWebhook = ({
const [formData, setFormData] = useState<IGlobalHostStatusWebhookFormData>({
enableHostStatusWebhook:
appConfig.webhook_settings.host_status_webhook
.enable_host_status_webhook || false,
?.enable_host_status_webhook || false,
hostStatusWebhookDestinationUrl:
appConfig.webhook_settings.host_status_webhook.destination_url || "",
appConfig.webhook_settings.host_status_webhook?.destination_url || "",
hostStatusWebhookHostPercentage:
appConfig.webhook_settings.host_status_webhook.host_percentage || 1,
appConfig.webhook_settings.host_status_webhook?.host_percentage || 1,
hostStatusWebhookWindow:
appConfig.webhook_settings.host_status_webhook.days_count || 1,
appConfig.webhook_settings.host_status_webhook?.days_count || 1,
});
const {