From 522d7eb69acf3745350df21aa02d5c9256f7bc07 Mon Sep 17 00:00:00 2001 From: "Arslan, Erdem" Date: Sun, 21 Jan 2024 21:15:51 +0100 Subject: [PATCH] fetch the consume and register/deregister endpoints and add error handling --- pkgs/ui/src/config/client_1/index.tsx | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/pkgs/ui/src/config/client_1/index.tsx b/pkgs/ui/src/config/client_1/index.tsx index 2d2cc20..84154ee 100644 --- a/pkgs/ui/src/config/client_1/index.tsx +++ b/pkgs/ui/src/config/client_1/index.tsx @@ -14,10 +14,14 @@ export const ClientTableConfig = [ label: "End Point", render: (value: any) => { const onConsume = () => { - // fetch(value).then(() => { }).catch(() => { }) + fetch(value).then((response) => { + console.log(response) + }).catch(error => { + console.log("Fetch error: ", error) + }) }; return ( - ); @@ -85,7 +89,11 @@ export const ServiceTableConfig = [ const onButtonClick = (endpoint: string) => { console.log("which endpoint comes here?", endpoint); - // fetch(endpoint).then(() => { }).catch(() => { }) + fetch(endpoint).then((response) => { + console.log(response); + }).catch(error => { + console.log("Fetch error: ", error) + }) }; if (!data) return
N/A
;