From 81fad6597ef0d8af2e95d7beed5399760a865dbb Mon Sep 17 00:00:00 2001 From: alphaeusmote <41258468-alphaeusmote@users.noreply.replit.com> Date: Thu, 10 Apr 2025 01:45:55 +0000 Subject: [PATCH] Update webhook page to use current organization ID Replit-Commit-Author: Agent Replit-Commit-Session-Id: 9111ef36-26c8-4085-84ca-a35dc1fec1b5 Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/7083d608-d6d3-4a6a-9a27-6286c5109627/b77439b0-5abb-4921-b953-7464162efa18.jpg --- client/src/pages/webhooks.tsx | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/client/src/pages/webhooks.tsx b/client/src/pages/webhooks.tsx index 7fd1f8d..74fb650 100644 --- a/client/src/pages/webhooks.tsx +++ b/client/src/pages/webhooks.tsx @@ -105,16 +105,16 @@ export default function WebhooksPage() { isLoading, error, } = useQuery({ - queryKey: ["/api/webhooks", selectedOrganization?.id], + queryKey: ["/api/webhooks", currentOrganization?.id], queryFn: async () => { - if (!selectedOrganization) return []; + if (!currentOrganization) return []; const res = await apiRequest( "GET", - `/api/webhooks?organizationId=${selectedOrganization.id}` + `/api/webhooks?organizationId=${currentOrganization.id}` ); return await res.json(); }, - enabled: !!selectedOrganization, + enabled: !!currentOrganization, }); // Create webhook mutation @@ -122,7 +122,7 @@ export default function WebhooksPage() { mutationFn: async (data: any) => { const res = await apiRequest("POST", "/api/webhooks", { ...data, - organizationId: selectedOrganization?.id, + organizationId: currentOrganization?.id, }); return await res.json(); }, @@ -132,7 +132,7 @@ export default function WebhooksPage() { description: "The webhook has been created successfully.", }); queryClient.invalidateQueries({ - queryKey: ["/api/webhooks", selectedOrganization?.id], + queryKey: ["/api/webhooks", currentOrganization?.id], }); setIsCreateOpen(false); resetForm(); @@ -158,7 +158,7 @@ export default function WebhooksPage() { description: "The webhook has been updated successfully.", }); queryClient.invalidateQueries({ - queryKey: ["/api/webhooks", selectedOrganization?.id], + queryKey: ["/api/webhooks", currentOrganization?.id], }); setIsEditOpen(false); resetForm(); @@ -183,7 +183,7 @@ export default function WebhooksPage() { description: "The webhook has been deleted successfully.", }); queryClient.invalidateQueries({ - queryKey: ["/api/webhooks", selectedOrganization?.id], + queryKey: ["/api/webhooks", currentOrganization?.id], }); setIsDeleteOpen(false); setCurrentWebhook(null); @@ -281,7 +281,7 @@ export default function WebhooksPage() { ]; // Helper to format the date - const formatDate = (dateString: string | null) => { + const formatDate = (dateString: string | null | undefined) => { if (!dateString) return "Never"; return new Date(dateString).toLocaleString(); }; @@ -370,7 +370,7 @@ export default function WebhooksPage() { {webhook.isActive ? ( - Active + Active ) : ( Inactive )} @@ -700,7 +700,7 @@ export default function WebhooksPage() {
{testResult?.success ? ( - + Success