From 8eaa60ed6c44db951a8e6526dcd0c20daff9a25c Mon Sep 17 00:00:00 2001 From: Pierre Gerbelot Date: Fri, 23 Jan 2026 15:29:06 +0100 Subject: [PATCH] feat(alert): adapt to new api for alerting --- .../notification-channel-modal.tsx | 13 +++++++++---- package.json | 2 +- yarn.lock | 10 +++++----- 3 files changed, 15 insertions(+), 10 deletions(-) diff --git a/libs/domains/observability/feature/src/lib/alerting/notification-channel-modal/notification-channel-modal.tsx b/libs/domains/observability/feature/src/lib/alerting/notification-channel-modal/notification-channel-modal.tsx index bf149865539..bb7b5ea2854 100644 --- a/libs/domains/observability/feature/src/lib/alerting/notification-channel-modal/notification-channel-modal.tsx +++ b/libs/domains/observability/feature/src/lib/alerting/notification-channel-modal/notification-channel-modal.tsx @@ -1,4 +1,6 @@ import { + type AlertReceiverCreationRequest, + type AlertReceiverEditRequest, type AlertReceiverResponse, type AlertReceiverType, type SlackAlertReceiverCreationRequest, @@ -76,12 +78,13 @@ export function NotificationChannelModal({ const webhookUrlValue = webhook_url === FAKE_PLACEHOLDER ? undefined : webhook_url const editPayload: SlackAlertReceiverEditRequest = { ...restData, + type: 'SLACK', description: alertReceiver.description ?? 'Webhook for Qovery alerts', ...(webhookUrlValue && webhookUrlValue.trim() !== '' ? { webhook_url: webhookUrlValue } : {}), } try { - await editAlertReceiver({ alertReceiverId: alertReceiver.id, payload: editPayload }) + await editAlertReceiver({ alertReceiverId: alertReceiver.id, payload: editPayload as AlertReceiverEditRequest }) onClose() } catch (error) { console.error(error) @@ -89,12 +92,13 @@ export function NotificationChannelModal({ } else { const createRequest: SlackAlertReceiverCreationRequest = { ...data, + type: 'SLACK', description: 'Webhook for Qovery alerts', organization_id: organizationId, } try { - await createAlertReceiver({ payload: createRequest }) + await createAlertReceiver({ payload: createRequest as AlertReceiverCreationRequest }) onClose() } catch (error) { console.error(error) @@ -115,13 +119,14 @@ export function NotificationChannelModal({ const formData = methods.getValues() const alertReceiverPayload: SlackAlertReceiverCreationRequest = { ...formData, + type: 'SLACK', organization_id: organizationId, description: 'Webhook for Qovery alerts', - webhook_url: webhookUrl, + webhook_url: webhookUrl ?? '', } validateAlertReceiver({ payload: { - alert_receiver: alertReceiverPayload, + alert_receiver: alertReceiverPayload as AlertReceiverCreationRequest, }, }) } diff --git a/package.json b/package.json index 4fb5463cd19..817090a25dd 100644 --- a/package.json +++ b/package.json @@ -69,7 +69,7 @@ "mermaid": "^11.6.0", "monaco-editor": "0.53.0", "posthog-js": "^1.260.1", - "qovery-typescript-axios": "^1.1.810", + "qovery-typescript-axios": "^1.1.812", "react": "18.3.1", "react-country-flag": "^3.0.2", "react-datepicker": "^4.12.0", diff --git a/yarn.lock b/yarn.lock index 578d1e7f288..b078280b2b1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5679,7 +5679,7 @@ __metadata: prettier: ^3.2.5 prettier-plugin-tailwindcss: ^0.5.14 pretty-quick: ^4.0.0 - qovery-typescript-axios: ^1.1.810 + qovery-typescript-axios: ^1.1.812 qovery-ws-typescript-axios: ^0.1.420 react: 18.3.1 react-country-flag: ^3.0.2 @@ -24520,12 +24520,12 @@ __metadata: languageName: node linkType: hard -"qovery-typescript-axios@npm:^1.1.810": - version: 1.1.810 - resolution: "qovery-typescript-axios@npm:1.1.810" +"qovery-typescript-axios@npm:^1.1.812": + version: 1.1.812 + resolution: "qovery-typescript-axios@npm:1.1.812" dependencies: axios: 1.12.2 - checksum: ede17ba36ba149256f91eab4420f9954fa43619b9029ce91864100dcbae1a0f6926187564edb8a386ee14e22f9fd5e352c42c0565e0d5708cd1a475af0c96f5e + checksum: f682cdeb07aa02164c9ee75a1ef8c914a0584e5fc1a3265c65a7583976af7b16d4a13e485e1e29f946ed1e9033aa378f152636a21793326773503bb2eb882714 languageName: node linkType: hard